[pmwiki-users] shared pages and skin-specific pagestores

Patrick R. Michaud pmichaud at pobox.com
Sun Aug 14 09:09:07 CDT 2005


On Sat, Aug 13, 2005 at 04:21:42PM -0400, Radu wrote:
> At 03:50 PM 8/13/2005, Patrick R. Michaud wrote:
> >On Sat, Aug 13, 2005 at 05:52:18AM -0400, Bronwyn Boltwood wrote:
> >> Also, thinking ahead, are variables set in config.php automatically 
> >global?
> >
> >Yes -- any variable in config.php is automatically global unless
> >it's defined inside of a function (in which case it has to be
> >explicitly declared global).
> 
> Are you sure? I recently had to take apart and put toghether the 
> light skin and in light.php if I don't declare variables as global 
> ($Author, $AuthorDef), they show up empty

In *config.php* (c.f. the original question), the variables are 
automatically global.

In a skin.php file, the variables are not automatically global,
because skin.php is loaded from within a PHP function.  Yes, it's
a lousy distinction, but unfortunately PHP doesn't provide an 
easy way around it.

Pm




More information about the pmwiki-users mailing list