Preparing your Geeklog Plugin Distribution

From GeeklogWiki
Jump to: navigation, search

The plugin tarfile

All Geeklog plugin tarfiles should use the following naming convention:

<plugin name>_<plugin version>_<geeklog version>.tar.gz

For example: photos_1.0_1.5.2.tar.gz

Descriptions

<plugin name>:
this is one of the single most important values you will choose for your plugin as it dictates the following:

  • The exact API function names that the Geeklog code will try to call for your plugin
  • The exact directory within the webtree to put all your plugin code
  • The exact directory within the admin directory to put your admin code
  • If using moderation, the exact table name and main table being moderated
  • If using moderation, the submission table will be <plugin name>submission

<plugin version>:
used during the installation process to determine if you are attempting to upgrade a plugin or do a new installation. It is also checked to verify that you aren't trying to install and old version of the plugin when a new installation already exists.

<geeklog version>:
this is the Geeklog version the plugin works under.

Files and Directories

The organization of your tarfile is standardized as well. For each directory and file a description is given. Your base plugin directory when you create the tarfile should be <plugin name>. Under there you will have the following:

config.php:
traditional configuration file for your plugin. We'd prefer that new plugins use the Configuration GUI if possible but using config.php is fine.

functions.inc:
this is the file where you implement the Geeklog Plugin API and where your plugin code should reside. It must be named this because we automatically include the function.inc files of all enabled plugins at the bottom of lib-common.php. Note that this means you have access to all the functions in lib-common.php in your plugin code.

README
standard readme for software

/docs:
includes any documentation you may want to provide for your plugin such as history, to-do, etc

/admin:
includes only your admininstration pages

/language:
the language files for your plugin. We recommend that you use a language directory and have a separate language file for each supported language (english.php, etc.), mirroring Geeklog's behaviour and selecting the language file based on the user's preferred language (falling back to english.php if you can't find a language file for the selected language).

/public_html:
includes your regular web pages

/sql:
table definitions for each supported DBMS

Personal tools
Namespaces

Variants
Actions
documentation
Tools