On Sun, May 22, 2011 at 8:19 PM, Patrick R. Michaud <[email protected]> wrote:
> The correct solution for getting/setting the group and
> pagename in config.php is already given at
> http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-group-page
>
>    ## Get the group and page name
>    $pagename = ResolvePageName($pagename);
>    $page = PageVar($pagename, '$FullName');
>    $group = PageVar($pagename, '$Group');
>    $name = PageVar($pagename, '$Name');

Am I mistaken in thinking that we've periodically run into
difficulties with this solution related to caching?

ResolvePageName calls MakePageName which calls FmtPagename which calls
PageVar which (a) calls PCache() (first problem) and (b) also calls
PageTextVar which calls RetrieveAuthPage which normally calls
PmWikiAuth (second problem).

My recollection (I can search thru archives to confirm -- I may be
remembering it wrong) is that the static $acache in PmWikiAuth as well
as the general $PCache can both cause problems if they are
called/cached early in config.php...

Thus if I need $group or $name early on in my config.php I can either
take a chance with $pagename without calling ResolvePageName or else
take a chance that I will open the door to later difficulties with
cached values (which are notoriously difficult to debug)...

Now one "solution" is to say "just don't call ResolvePageName() until
near the end of config.php".  And this is generally possible...  But
there are certain circumstances (Oliver's appears to be a good example
where he needs the values related to XL which needs to be early) when
there needs to be a non-cache-dependent solution...

PITS/01177 is related.

-Peter

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to