[pmwiki-users] Urgent: $DefaultPage stopped working ??

Patrick R. Michaud pmichaud at pobox.com
Sat May 19 01:36:30 CDT 2007


On Sat, May 19, 2007 at 07:24:17AM +0100, Hans wrote:
> Saturday, May 19, 2007, 5:27:24 AM, Kathryn Andersen wrote:
> >> Interesting: Here is the opening of my farmconfig.php file
> >> 
> >> <?php
> >> $FarmPubDirUrl = 'http://wiki.hindu.org/pmwiki/pub';
> >> ## global passwords here snipped ###
> >> $EnablePageListProtect = 0;
> >> include_once("$FarmD/cookbook/cluster.php");
> >
> > Cluster calls ResolvePageName() as part of its initialization.
> > I'm not sure how to solve this problem -- it's the usual chicken-and-egg
> > problem with ResolvePageName that seems to happen quite a lot.
> 
> Perhaps simply generally do not load any scripts from farmconfig.php,
> but load them instead from a wiki's config.php, and after $DefaultName
> and other customisations are set, i.e. put your include_once lines
> near the bottom of the config.php files.

Another possibility is to call local/config.php from within farmconfig.php
prior to loading the other recipes:

  <?php
  $FarmPubDirUrl = 'http://wiki.hindu.org/pmwiki/pub';
  ## global passwords here snipped ###
  $EnablePageListProtect = 0;
  include_once('local/config.php'); ### <----- load wiki's customizations
  include_once("$FarmD/cookbook/cluster.php");

In fact, it doesn't have to be local/config.php, one can have multiple 
specialized per-wiki configuration files.  For example, the settings for
$DefaultPage could be put in a "local/config-early.php" file for each
wiki:

  <?php
  $FarmPubDirUrl = 'http://wiki.hindu.org/pmwiki/pub';
  ## global passwords here snipped ###
  $EnablePageListProtect = 0;
  include_once('local/config-early.php'); ### <----- load wiki's early customizations
  include_once("$FarmD/cookbook/cluster.php");
  ...

Pm



More information about the pmwiki-users mailing list