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

Jonathan Scott Duff duff
Fri Jul 16 10:18:21 CDT 2004


On Fri, Jul 16, 2004 at 04:54:51PM +0200, Christian Ridderstr??m wrote:
> I've previously had the problem that what I really want to do is a
> search-and-replace in a variable defined by stdconfig.php. The quick hack
> is to define the variable myself (before stdconfig.php is invoked), and
> set it accordingly. The drawback with this is that you may have to update
> your plugin when stdconfig.php makes a tiny change to that variable. 

I'm confused.  If you've set a variable before stdconfig.php is
invoked, then stdconfig.php won't (shouldn't) touch it at all.

Oh wait, I see. You mean you want to keep your changes in sync with
whatever stdconfig.php does except for the bit that you want to change,
right? What happens when stdconfig.php changes the part of the string
that you key off of to make your change? If you're just doing a
substitution, then your code is likely to break and the plugin will need
updating anyway. As long as you're updating it, you might as well just
copy the string from stdconfig.php into your plugin.php and make the
changes you desire.

Even if the chances that stdconfig.php will change the part of the
string that you key off of are small, it's still better to just set the
string how you want it rather than relying on modifying some predefined
value IMHO.

> Not to mention that I usually just want to change a small bit, and
> it's often a variable with a long string.

How hard is it to cut-n-paste from one file to another and make the
changes?

-Scott
-- 
Jonathan Scott Duff
duff at pobox.com



More information about the pmwiki-users mailing list