[pmwiki-devel] PostPage in recipe

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 31 09:26:08 CDT 2009


On Tue, Mar 31, 2009 at 12:30:31PM +0200, Frank Schweickert wrote:
>  
> 
>         Typically, the functions of pmwiki.php should ''not be called
>         directly'' in a cookbook recipe which is executed as include file in
>         config.php.
> 
> 
>     While this is true for UpdatePage() I'm not convinced it is a general
>     rule...
> 
> This general rule was my initial question to this mailing list. As long as one
> cannot be sure about the appropriate context, using handlers are the safe way,
> aren't they? I, for instance, would have destroyed all my page histories
> otherwise ...

I think the likely reason why your page histories weren't being 
preserved is that PmWiki had not had an opportunity to load 
scripts/phpdiff.php (the module responsible for calculating the history).
So, UpdatePage() was indeed working from incomplete information.

In general the way to get PmWiki to complete its standard initialization 
is to load the stdconfig.php script:

    include_once('scripts/stdconfig.php');

> I suggest promoting Custom Markup and Custom Actions as the two main
> customization features for add-on scripts. My own earlier naive approach of
> scripting effectively during execution config.php (albeit in cookbook includes)
> is not the way that "layman" add-on authors should be guided too.

Keep in mind that custom markup is _far_ more common than custom actions.

Pm




More information about the pmwiki-devel mailing list