Anatomy of a Plugin

From LabTrove Documentation
Jump to: navigation, search

If you want to build a complex plugin you should use thr following structure:

  • <PLUGIN_NAME>
    • README.txt - Explains the functionality of the plugin.
    • VERSION.txt - Version information about the plugin.
    • install.sh - Installer for plugin.
    • install.sql - Tables and rows to be created when installing the plugin.
    • uninstall.sh - Uninstaller for plugin.
    • uninstall.sql - Tables to be dropped when uninstalling the plgin.
    • scripts/ - Scripts that the plugin runs.
    • docs/ - installer will copy this directory to /docs/<PLUGIN_NAME>.
    • plugin.php - Functions for plugin and hook function definitions. All functions should start with <PLUGIN_NAME>.
    • config_template.php - Template configuration for the plugin. Installer will use this to create config.php with specific configuration.