On Sat, Jun 09, 2007 at 08:52:13PM +0200, Petko Yotov wrote: > 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.
Correct. I really meant to say "near the top" of config.php, as opposed to "at the top". > 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. Correct again. Anything that affects the way pages are located needs to occur even earlier than authuser.php. > 3. Internationalisations (calls to XLPage()) must come *after* UTF-8 was set. > Even if the xl-page contains the utf-8 locale. This shouldn't be the case -- if the XLPage contains the utf-8 locale then it shouldn't be necessary to load scripts/xlpage-utf-8.php as a separate step. > 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. I've been thinking that we need a page that summarizes the preferred order of initialization for all recipes and settings, instead of having it spread across multiple pages. Pm _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
