[pLog-svn] r5274 - plugins/branches/lifetype-1.2/cssnaked

Oscar Renalias oscar at renalias.net
Thu Apr 5 01:59:23 EDT 2007


On 4/5/07, Reto Hugi <plog at hugi.to> wrote:
> sorry, this was weird talking, it's late...
>
> I try again :)
>
> oh, and the ouput filter works great, I should just have taken more
> attention to what I get as parameters to the process() method. Most of the
> plugins do $blogsettings->getValue('config_value') stuff in the
> register() method,
> but I guess it would be better to do this in the process() method, right?
> register should only be used to check if we need to 'install' something...

Actually, no :-)

According to our own API (which I myself had to check because I had
already forgotten :-)), PluginBase::register() is used every time the
plugin is initialized and it is the right place to query things like
blog settings or parameters. That's because when the constructor of
the plugin is called, we still don't have things like a BlogInfo or
UserInfo object.

The PluginBase::install() method is the one you should use to do
things that should be done only once like initializing database
tables.

More info below :-)

http://www.lifetype.net/api/class_plugin_base.php#789152657a9e125b0472200a3b25a3db
http://www.lifetype.net/api/class_plugin_base.php#410f789b27e663f43b4699893f624bec

This is how it should work, but it could be that we've mixed up these
two methods in some plugins...

Oscar


More information about the pLog-svn mailing list