DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:preload

Preload

  • inc/preload.php is not part of the default dokuwiki installation
  • inc/init.php attempts to include inc/preload.php before it does anything else
  • preload.php has the opportunity override many aspects of standard dokuwiki, incl.
    • most of the directory locations
    • the configuration cascade
    • the plugin controller

It is of particular interest to wiki farms allowing them control several independent wikis from a single dokuwiki installation.

See also

Examples

Local Config Folder

preload.php
<?php
/**
 *  Sample preload.php to use a separate folder for all local configuration settings
 * 
 *  By default this script will locate the local config files in
 *      /path/to/doku/conf/local/
 * 
 *  The locations of both the default dokuwiki configuration and local configuration
 *  can be controlled using DOKU_DEFAULT & DOKU_CONF.
 * 
 *  NOTE: DOKU_CONF controls the location of several other files not contained in the
 *  configuration cascade.  They are:
 *    acl.auth.php
 *    users.auth.php
 *    userscript.php
 *    userstyle.css (and media specific user stylesheets, e.g. userscreen.css, userprint.css)
 *    report_e_all
 *    msg
 *
 */
 
if(!defined('DOKU_DEFAULT')) define('DOKU_DEFAULT',DOKU_INC.'conf/');
if(!defined('DOKU_CONF')) define('DOKU_CONF',DOKU_DEFAULT.'local/');
 
global $config_cascade;
$config_cascade = array(
  'main' => array(
    'default'   => array(DOKU_DEFAULT.'dokuwiki.php'),
    'local'     => array(DOKU_CONF.'dokuwiki.php'),
    'protected' => array(DOKU_CONF.'protected.php'),
  ),
  'acronyms'  => array(
    'default'   => array(DOKU_DEFAULT.'acronyms.conf'),
    'local'     => array(DOKU_CONF.'acronyms.conf'),
  ),
  'entities'  => array(
    'default'   => array(DOKU_DEFAULT.'entities.conf'),
    'local'     => array(DOKU_CONF.'entities.conf'),
  ),
  'interwiki' => array(
    'default'   => array(DOKU_DEFAULT.'interwiki.conf'),
    'local'     => array(DOKU_CONF.'interwiki.conf'),
  ),
  'license' => array(
    'default'   => array(DOKU_DEFAULT.'license.php'),
    'local'     => array(DOKU_CONF.'license.php'),
  ),
  'mediameta' => array(
    'default'   => array(DOKU_DEFAULT.'mediameta.php'),
    'local'     => array(DOKU_CONF.'mediameta.php'),
  ),
  'mime'      => array(
    'default'   => array(DOKU_DEFAULT.'mime.conf'),
    'local'     => array(DOKU_CONF.'mime.conf'),
  ),
  'scheme'    => array(
    'default'   => array(DOKU_DEFAULT.'scheme.conf'),
    'local'     => array(DOKU_CONF.'scheme.conf'),
  ),
  'smileys'   => array(
    'default'   => array(DOKU_DEFAULT.'smileys.conf'),
    'local'     => array(DOKU_CONF.'smileys.conf'),
  ),
  'wordblock' => array(
    'default'   => array(DOKU_DEFAULT.'wordblock.conf'),
    'local'     => array(DOKU_CONF.'wordblock.conf'),
  ),
  'acl'       => array(
    'default'   => DOKU_CONF.'acl.auth.php',
  ),
  'plainauth.users' => array(
    'default'   => DOKU_CONF.'users.auth.php',
  ),
  'plugins' => array(
    'local'     => array(DOKU_CONF.'plugins.local.php'),
    'protected' => array(
      DOKU_CONF.'plugins.required.php',
      DOKU_CONF.'plugins.protected.php',
    ),
  ),
  'userstyle' => array(
    'default' => DOKU_CONF.'userstyle.css',
    'print'   => DOKU_CONF.'printstyle.css',
    'feed'    => DOKU_CONF.'feedstyle.css',
    'all'     => DOKU_CONF.'allstyle.css',
  ),
  'userscript' => array(
    'default' => DOKU_CONF.'userscript.js'
  ),
);
devel/preload.txt · Last modified: 2023-07-20 14:17 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki