[pmwiki-users] place of the cookbook links

Petko Yotov 5ko at free.fr
Sat Jun 9 13:52:13 CDT 2007


On Saturday 09 June 2007, Patrick R. Michaud wrote:
> On Fri, Jun 08, 2007 at 05:52:40PM +0200, jdd wrote:
> > May be I didn't read enough, but I din't remember having seeing where
> > is the prefered place to include the cookbook links in config.php.
> >
> > When one open a file with an editor, most of the time the pointer is
> > set at the beginneing of the file, so this beginners first go is to
> > write them here.
> >
> > I think most normal people think to place them after the first
> > (<?php...) line.
> >
> > But is it better to write them here or at the end of the file?
>
> It depends on the recipe.  Recipes that alter passwords or page
> security (e.g., userauth.php or userauth2.php) really need to
> go at the top of config.php.  Other recipes make more sense at
> the bottom of config.php, and still others it makes no difference.

Patrick, I happen to disagree. There are problems with the recipe orders. This 
is my advice for config.php, based on a lot of experience:

1. If there is a Per-Group Sub-directory setting, or a similar PageStore 
mechanism, it must to be set before most other scripts or recipes, especially 
before authuser.php. Otherwise, the recipes may search for the files at a 
wrong place, and when you change some configuration, it may not be detected.

2. UTF-8, (include(scripts/xlpage-utf-8.php);) must be set before any call to 
ResolvePageName(), which may be called by some recipe. Or else, for other 
languages than English (accented characters, other alphabets) it happens that 
PmWiki does not see the files.

3. Internationalisations (calls to XLPage()) must come *after* UTF-8 was set. 
Even if the xl-page contains the utf-8 locale.

4. Then, any other *core script* or recipe, and probably authuser.php, 
userauth2.php before all other.

I have added these notes at [1], [2] and [3] because it took me an enormous 
amount of time and headaches to discover how to fix it.

Thanks,
Petko

[1] http://pmwiki.org/wiki/PmWiki/Internationalizations
[2] http://pmwiki.org/wiki/Cookbook/PerGroupSubDirectories
[3] http://pmwiki.org/wiki/Cookbook/UTF-8




More information about the pmwiki-users mailing list