[geeklog-devel] RFC: Plugin auto install

Dirk Haun 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  
approach.

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:

- plugin_autoinstall_foo
   Provides the information about the plugin: Name, permissions, groups, ...

- plugin_load_configuration_foo
   For plugins using Geeklog's Configuration GUI

- plugin_postinstall_foo
   For any post-install operations that the plugin may need to perform

- plugin_compatible_with_this_version_foo
   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  
installed).

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.

bye, Dirk

P.S. You can get the latest development version by checking it out  
through Mercurial or download the Nightly Tarball, as explained here:
http://www.geeklog.net/staticpages/index.php/CVS




More information about the geeklog-devel mailing list