Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d6b9c7bffa
Fetching contributors…

Cannot retrieve contributors at this time

file 106 lines (99 sloc) 4.651 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
<?php
/**
* Load all internal libraries and setup class autoloader
*
* @author Andreas Gohr <andi@splitbrain.org>
*/

// setup class autoloader
spl_autoload_register('load_autoload');

// require all the common libraries
// for a few of these order does matter
require_once(DOKU_INC.'inc/blowfish.php');
require_once(DOKU_INC.'inc/actions.php');
require_once(DOKU_INC.'inc/changelog.php');
require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/confutils.php');
require_once(DOKU_INC.'inc/pluginutils.php');
require_once(DOKU_INC.'inc/plugin.php');
require_once(DOKU_INC.'inc/events.php');
require_once(DOKU_INC.'inc/form.php');
require_once(DOKU_INC.'inc/fulltext.php');
require_once(DOKU_INC.'inc/html.php');
require_once(DOKU_INC.'inc/httputils.php');
require_once(DOKU_INC.'inc/indexer.php');
require_once(DOKU_INC.'inc/infoutils.php');
require_once(DOKU_INC.'inc/io.php');
require_once(DOKU_INC.'inc/mail.php');
require_once(DOKU_INC.'inc/media.php');
require_once(DOKU_INC.'inc/pageutils.php');
require_once(DOKU_INC.'inc/parserutils.php');
require_once(DOKU_INC.'inc/search.php');
require_once(DOKU_INC.'inc/subscription.php');
require_once(DOKU_INC.'inc/template.php');
require_once(DOKU_INC.'inc/toolbar.php');
require_once(DOKU_INC.'inc/utf8.php');
require_once(DOKU_INC.'inc/auth.php');

/**
* spl_autoload_register callback
*
* Contains a static list of DokuWiki's core classes and automatically
* require()s their associated php files when an object is instantiated.
*
* @author Andreas Gohr <andi@splitbrain.org>
* @todo add generic loading of renderers and auth backends
*/
function load_autoload($name){
    static $classes = null;
    if(is_null($classes)) $classes = array(
        'DokuHTTPClient' => DOKU_INC.'inc/HTTPClient.php',
        'HTTPClient' => DOKU_INC.'inc/HTTPClient.php',
        'JSON' => DOKU_INC.'inc/JSON.php',
        'adLDAP' => DOKU_INC.'inc/adLDAP.php',
        'Diff' => DOKU_INC.'inc/DifferenceEngine.php',
        'UnifiedDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php',
        'TableDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php',
        'cache' => DOKU_INC.'inc/cache.php',
        'cache_parser' => DOKU_INC.'inc/cache.php',
        'cache_instructions' => DOKU_INC.'inc/cache.php',
        'cache_renderer' => DOKU_INC.'inc/cache.php',
        'Doku_Event' => DOKU_INC.'inc/events.php',
        'Doku_Event_Handler' => DOKU_INC.'inc/events.php',
        'EmailAddressValidator' => DOKU_INC.'inc/EmailAddressValidator.php',
        'JpegMeta' => DOKU_INC.'inc/JpegMeta.php',
        'SimplePie' => DOKU_INC.'inc/SimplePie.php',
        'FeedParser' => DOKU_INC.'inc/FeedParser.php',
        'IXR_Server' => DOKU_INC.'inc/IXR_Library.php',
        'IXR_Client' => DOKU_INC.'inc/IXR_Library.php',
        'IXR_IntrospectionServer' => DOKU_INC.'inc/IXR_Library.php',
        'Doku_Plugin_Controller'=> DOKU_INC.'inc/plugincontroller.class.php',
        'GeSHi' => DOKU_INC.'inc/geshi.php',
        'TarLib' => DOKU_INC.'inc/TarLib.class.php',
        'ZipLib' => DOKU_INC.'inc/ZipLib.class.php',
        'DokuWikiFeedCreator' => DOKU_INC.'inc/feedcreator.class.php',
        'Doku_Parser_Mode' => DOKU_INC.'inc/parser/parser.php',
        'SafeFN' => DOKU_INC.'inc/SafeFN.class.php',
        'Sitemapper' => DOKU_INC.'inc/Sitemapper.php',
        'PassHash' => DOKU_INC.'inc/PassHash.class.php',
        'Mailer' => DOKU_INC.'inc/Mailer.class.php',
        'RemoteAPI' => DOKU_INC.'inc/remote.php',
        'RemoteAPICore' => DOKU_INC.'inc/RemoteAPICore.php',

        'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php',
        'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php',
        'DokuWiki_Syntax_Plugin' => DOKU_PLUGIN.'syntax.php',
        'DokuWiki_Remote_Plugin' => DOKU_PLUGIN.'remote.php',

    );

    if(isset($classes[$name])){
        require_once($classes[$name]);
        return;
    }

    // Plugin loading
    if(preg_match('/^(helper|syntax|action|admin|renderer|remote)_plugin_([^_]+)(?:_([^_]+))?$/',
                  $name, $m)) {
                //try to load the wanted plugin file
        // include, but be silent. Maybe some other autoloader has an idea
        // how to load this class.
        $c = ((count($m) === 4) ? "/{$m[3]}" : '');
        @include DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
        return;
    }
}
Something went wrong with that request. Please try again.