[Pmwiki-users] pmwiki-2.0.beta6 released

John Rankin john.rankin
Mon Dec 6 13:54:21 CST 2004

On Monday, 6 December 2004 10:49 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Mon, Dec 06, 2004 at 10:24:20AM +1300, John Rankin wrote:
>> 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.

In beta 5, how come print.php doesn't have a global statement?
If this is a bug, I rest my case. 

So what happens with any function xyz(...) declarations inside
skinx/skinx.php? Are these local to SetSkin, global, or an error?
>> 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.

Hmmm, if one has to declare /some/ things in a local/ script, one 
may as well declare everything. At the moment, I have put the scripts
in the skin dir, but am loading them from local/config.php -- which
seems not very sensible.

>> 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...

Yes, the trouble is that skinx/skinx.php loads in the middle of SetSkin.
One could split it into 3 pieces I suppose...

John Rankin

More information about the pmwiki-users mailing list