[geeklog-devel] RFC: Plugin auto install
dirk at haun-online.de
Wed Jan 7 06:53:45 EST 2009
Part of Matt's GSoC project was to make the plugin installation
easier. In case you haven't tried out the current version from our
Mercurial repository: You can now install plugins by simply uploading
their tarball. Also, the bundled plugins have now been properly
separated from Geeklog, i.e. they are no longer contained in the
mysql_tableanddata.php file. To remove, say, the Polls plugin, you can
simply remove its 3 directories from the Geeklog tarball - the rest
will still install just fine.
One thing we didn't get resolved during the summer was how to handle
automatic installation of plugins now. The standard plugin install
scripts are made for user interaction and also check for permissions,
which simply may not exist during an initial install. So we need a new
The idea is that plugins can supply a new file, autoinstall.php. From
this file, Geeklog will get the plugin's data (permissions, groups,
etc.). The plugin can also provide functions that check the
prerequisites and do any post-install operations necessary.
Most of the install process, though, will be done by Geeklog now,
based on the information it gets from autoinstall.php. If you ever had
a look at the plugin install scripts for the bundled plugins in 1.5.x,
you'll see that they are pretty generic already and only have a
plugin-specific section at their start. All that generic code has now
been rolled into Geeklog and the autoinstall.php is simply the new way
of that plugin-specific section.
There are 4 functions that can be present in an autoinstall.php, only
one of which is mandatory:
Provides the information about the plugin: Name, permissions, groups, ...
For plugins using Geeklog's Configuration GUI
For any post-install operations that the plugin may need to perform
To check the prerequisites
Only the plugin_autoinstall_ function is required. It should only
return information, not perform any operations, as it will be called
more than once (and being called doesn't mean that the plugin will be
Plugins using an old-style install script will continue to work, of
course. They will simply require one extra step (calling the install
script) to be installed.
All plugin authors: Please have a look at the autoinstall.php files of
the bundled plugins - they are pretty straightforward and easy to
understand - and let us know if you see any problems with this approach.
P.S. You can get the latest development version by checking it out
through Mercurial or download the Nightly Tarball, as explained here:
More information about the geeklog-devel