[pmwiki-users] Separate wikilib.d into separate directories
Patrick R. Michaud
pmichaud at pobox.com
Mon Jul 14 14:05:31 CDT 2008
On Mon, Jul 14, 2008 at 09:20:55PM +0300, Eemeli Aro wrote:
> 2008/7/14 Patrick R. Michaud <pmichaud at pobox.com>:
> > I don't know if you've looked at the Markup() code, but getting the '<lib'
> > stuff to work the same way that Markup() does it is a _real_ pain.
> > I'd hate to re-implement it all over again just for PageStores, or to
> > try to refactor Markup() and PageStore to use a common code library
> > for this. (I.e., that approach is much more work than I want.)
> >
> > I might try a lighter version of it, though, that doesn't do all
> > of the just-in-time calculation that Markup() and BuildMarkupRules()
> > currently do. For compatibility reasons, though, I think we need
> > to keep $WikiLibDirs essentially the same as it is now, and just
> > provide a function to make it easier to manipulate $WikiLibDirs.
>
> How about changing the $WikiLibDirs declaration to the following:
>
> $WikiLibDirs = array(
> 10 => &$WikiDir,
> 100 => new PageStore('$FarmD/wikilib.d/{$FullName}')
> );
>
> and adding
>
> if (IsEnabled($EnableSortWikiLibDirs,0)) ksort($WikiLibDirs);
>
> after the config files have been read?
This causes the following code (used by several recipes and skins)
to break:
array_splice($WikiLibDirs, isset($WikiLibDirs[1])?-1:1, 0,
array(new PageStore('$FarmD/recipe.d/{$FullName}')));
Also, I'm not sure that we can assume that ksort at the
end of the configuration files is sufficient -- we might need
to read pages before configuration is finished, or there might
be some markups or functions that modify $WikiLibDirs after
configuration has completed.
Pm
More information about the pmwiki-users
mailing list