[Pmwiki-users] Re: Request for method to let plugins execute code after stdconfig.php

chr@home.se chr
Fri Jul 16 09:32:05 CDT 2004


On Fri, 16 Jul 2004, Patrick R. Michaud wrote:

> I've always held the position that it's okay for a script to
> do include_once() on any other script that it depends on, including
> stdconfig.php.  However, scripts that do this need to make it clear
> to others that any other local customizations need to be done before
> the script is loaded.

I think it's common for plugins to do:
	$Enable... = 1; // or 0
and it's easy to miss that this means a dependency on stdconfig.php to be 
included after this plugin has been executed. 

> But if that's too distasteful, I still like the "include_after"
> approach suggested in my previous message.

I just realized that your 'include_after' can be used to do a subset of 
what my Hook-class does:

	//In config.php:
	include_once('plugin.php')

	//In plugin.php
	...
	include_after('plugin_after.php')
	...

The drawback is that you need to use two files. Would you consider this
more transparent? (Seems about the same to me, except you can
differentiate between prepend and append to the hook list).

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr




More information about the pmwiki-users mailing list