[pmwiki-users] Re: Fixed: Another ExtendedMarkup annoyance

Patrick R. Michaud pmichaud at pobox.com
Wed Sep 7 21:03:50 CDT 2005

On Thu, Sep 08, 2005 at 10:27:19AM +1200, John Rankin wrote:
> >Why not reusing core functionalities instead of redefining
> >them?
> >
> >Instead of:
> >...
> >SDV($WikiStylePattern,'%%|%[A-Za-z][-,=:#\\w\\s\'"]*%');
> How do I know that somewhere later in the config.php file an
> administrator hasn't disabled wikistyles? 

This is just a general comment on my view of configuration and the
way I'm trying to design it.  If a recipe wants to make use of a 
core feature that is in the scripts/ directory, it's generally 
okay to load it directly.

In this case, I'd think it's perfectly valid for extendmarkup.php
to do an include_once("$FarmD/scripts/wikistyle.php"); to load it,
just as if it had been defined in the preamble of pmwiki.php.
If extendmarkup.php *requires* wikistyle.php to work then it's 
okay to load it even if the administrator has later disabled it;
if the use of wikistyles remains optional, it's okay for
extendmarkup to examine the setting of $EnableStdWikiStyles
to decide to load it (same as scripts/stdconfig.php does).

Yes, it's possible that the administrator might've disabled 
wikistyles later in the config.php file, but I think it's reasonable
for recipe designers to assume that an administrator will make
such declarations before the recipe is loaded (or to figure out
that this is what they need to do).

> I think a better solution would be 
> to define the style pattern in the pmwiki core, along with all other 
> patterns. 

This is reasonable; I've done it the current way because in general
I like to keep related things together (and avoid defining things
that won't be needed).  I suppose I can see about moving some of
the patterns into the core, but I'll have to think about it a bit


More information about the pmwiki-users mailing list