[Pmwiki-users] my final(?) take on the customization sequence

Robert P. J. Day rpjday
Sun Oct 17 08:22:59 CDT 2004


  sorry for flogging this, but i want to make sure i understand the
exact customization file sequence, and there seem to be at least a
couple places where the code doesn't agree with the docs.

  how i read the overall customization sequence:

pmwiki.php:
----------

  @include_once("$FarmD/scripts/version.php");   # trivial inclusion
  ...
  if (file_exists("$FarmD/local/farmconfig.php"))
    include_once("$FarmD/local/farmconfig.php");
  if (!isset($EnableLocalConfig) || $EnableLocalConfig) {
    if (file_exists('local/config.php'))
      { include_once('local/config.php'); $LocalConf=1; }
    elseif (file_exists('local.php'))
      { include_once('local.php'); $LocalConf=1; }
    elseif (file_exists('local/local.php'))
      { include_once('local/local.php'); $LocalConf=1; }
  }

  (i'm assuming that, if you're using a farm, you'd have the
   opportunity to set $EnableLocalConfig in the farmconfig.php
   file, right?  and after that, it's local/config.php that
   would clearly be consulted.  after which, still in pmwiki.php,
   we find:)

  if ($EnableStdConfig)
    @include_once("$FarmD/scripts/stdconfig.php");

  (so once you have your own local/config.php, you could play
   with $EnableStdConfig, which conceivably pulls in a *lot* more
   customization.)

scripts/stdconfig.php:
---------------------

  /* To avoid processing any of the features of this file, set
        $EnableStdConfig = 0;
    in config.php. */    makes sense
  ...
  if (!isset($EnablePerGroupCust) || $EnablePerGroupCust)
    include_once("$FarmD/scripts/pgcust.php");

  (ok, that last part also seems to make sense, so you can choose
   per-group customization, again, in local/config.php, as well
   as a *load* of other include files further down.  so far, so
   good, and selecting per-group customization would pull in ...

scripts/pgcust.php:
------------------

  /* ...This script enables per-page and per-group customizations in
    the local/ subdirectory. */

whoa, hang on there.  so this file activates *both* per-page and
per-group customization?  that's not what the including script
claimed.  inclusion of this file is apparently controlled by the
$EnablePerGroupCust variable, it doesn't say anything about
$EnablePerPageCust or something like that.  that's a bit misleading
and confusing, no?

  in addition, that file still includes based on the default group:

  elseif (file_exists("local/$DefaultGroup.php"))
    include_once("local/$DefaultGroup.php");

  which i thought wasn't the case with pmwiki 2.

(note: the pgcust.php also seems to have some old cruft left at the
top:

Per-group customizations can be handled at any time by adding
     include_once("scripts/pgcust.php");
  to config.php.  It is automatically included by scripts/stdconfig.php
  unless $EnablePerGroupCust is set to zero in local.php.
                                               ^^^^^  config.php?)

pedantically yours,
rday




More information about the pmwiki-users mailing list