[Pmwiki-users] pmwiki-2.0.beta6 released
Patrick R. Michaud
Sun Dec 5 14:49:39 CST 2004
On Mon, Dec 06, 2004 at 10:24:20AM +1300, John Rankin wrote:
> Question about loading skinx/skinx.php
> Is it deliberate that the include of skinx.php is inside a function,
> thus making any variable settings local rather than global? To make
> things work, I changed all $variable to $GLOBALS['variable'].
Welllllll.... it wasn't deliberate when I did it, but I'm not sure
I want to change it, either. In the scripts/skins.php code I figured
it would be better to set everything up using a SetSkin() function that
could be easily called (e.g., from markup). Unfortunately, this means
that any include_once() of skin.php that takes place does so inside
the scope of the SetSkin() function, and not globally.
And on mine I just did
global $var1, $var2, ...;
to get access to the globals.
> The consequence is that one can't move a skin script from
> local/ to pub/skins/ and have it just work.
Well, you can if you predeclare your globals in the local/ script, too.
> It seems to me that including local, group and skin scrips should
> all work the same way...
In many senses I agree (this oddity caught me as well), in another
I'm not sure that it's worth losing SetSkin() as a separate function.
But I can be persuaded on this one...
More information about the pmwiki-users