116905344SAndreas Gohr<?php 216905344SAndreas Gohr/** 316905344SAndreas Gohr * Load all internal libraries and setup class autoloader 416905344SAndreas Gohr * 516905344SAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org> 616905344SAndreas Gohr */ 716905344SAndreas Gohr 816905344SAndreas Gohr// setup class autoloader 916905344SAndreas Gohrspl_autoload_register('load_autoload'); 1016905344SAndreas Gohr 1116905344SAndreas Gohr// require all the common libraries 1205ed2c25SAndreas Gohr// for a few of these order does matter 1316905344SAndreas Gohrrequire_once(DOKU_INC.'inc/blowfish.php'); 1416905344SAndreas Gohrrequire_once(DOKU_INC.'inc/actions.php'); 1516905344SAndreas Gohrrequire_once(DOKU_INC.'inc/changelog.php'); 1616905344SAndreas Gohrrequire_once(DOKU_INC.'inc/common.php'); 1716905344SAndreas Gohrrequire_once(DOKU_INC.'inc/confutils.php'); 1816905344SAndreas Gohrrequire_once(DOKU_INC.'inc/pluginutils.php'); 1916905344SAndreas Gohrrequire_once(DOKU_INC.'inc/plugin.php'); 2016905344SAndreas Gohrrequire_once(DOKU_INC.'inc/events.php'); 2116905344SAndreas Gohrrequire_once(DOKU_INC.'inc/form.php'); 2216905344SAndreas Gohrrequire_once(DOKU_INC.'inc/fulltext.php'); 2316905344SAndreas Gohrrequire_once(DOKU_INC.'inc/html.php'); 2416905344SAndreas Gohrrequire_once(DOKU_INC.'inc/httputils.php'); 2516905344SAndreas Gohrrequire_once(DOKU_INC.'inc/indexer.php'); 2616905344SAndreas Gohrrequire_once(DOKU_INC.'inc/infoutils.php'); 2716905344SAndreas Gohrrequire_once(DOKU_INC.'inc/io.php'); 2816905344SAndreas Gohrrequire_once(DOKU_INC.'inc/mail.php'); 2916905344SAndreas Gohrrequire_once(DOKU_INC.'inc/media.php'); 3016905344SAndreas Gohrrequire_once(DOKU_INC.'inc/pageutils.php'); 3116905344SAndreas Gohrrequire_once(DOKU_INC.'inc/parserutils.php'); 3216905344SAndreas Gohrrequire_once(DOKU_INC.'inc/search.php'); 3316905344SAndreas Gohrrequire_once(DOKU_INC.'inc/subscription.php'); 3416905344SAndreas Gohrrequire_once(DOKU_INC.'inc/template.php'); 3516905344SAndreas Gohrrequire_once(DOKU_INC.'inc/toolbar.php'); 3616905344SAndreas Gohrrequire_once(DOKU_INC.'inc/utf8.php'); 3716905344SAndreas Gohrrequire_once(DOKU_INC.'inc/auth.php'); 3816905344SAndreas Gohr 3916905344SAndreas Gohr/** 4016905344SAndreas Gohr * spl_autoload_register callback 4116905344SAndreas Gohr * 4216905344SAndreas Gohr * Contains a static list of DokuWiki's core classes and automatically 432dcde304SAndreas Gohr * require()s their associated php files when an object is instantiated. 4416905344SAndreas Gohr * 4516905344SAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org> 46d54ac877SAdrian Lang * @todo add generic loading of renderers and auth backends 4716905344SAndreas Gohr */ 4816905344SAndreas Gohrfunction load_autoload($name){ 4916905344SAndreas Gohr static $classes = null; 5016905344SAndreas Gohr if(is_null($classes)) $classes = array( 5116905344SAndreas Gohr 'DokuHTTPClient' => DOKU_INC.'inc/HTTPClient.php', 52a1d9de52SAndreas Gohr 'HTTPClient' => DOKU_INC.'inc/HTTPClient.php', 5316905344SAndreas Gohr 'JSON' => DOKU_INC.'inc/JSON.php', 5416905344SAndreas Gohr 'adLDAP' => DOKU_INC.'inc/adLDAP.php', 5516905344SAndreas Gohr 'Diff' => DOKU_INC.'inc/DifferenceEngine.php', 5616905344SAndreas Gohr 'UnifiedDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php', 5716905344SAndreas Gohr 'TableDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php', 5816905344SAndreas Gohr 'cache' => DOKU_INC.'inc/cache.php', 5916905344SAndreas Gohr 'cache_parser' => DOKU_INC.'inc/cache.php', 6016905344SAndreas Gohr 'cache_instructions' => DOKU_INC.'inc/cache.php', 6116905344SAndreas Gohr 'cache_renderer' => DOKU_INC.'inc/cache.php', 6216905344SAndreas Gohr 'Doku_Event' => DOKU_INC.'inc/events.php', 6316905344SAndreas Gohr 'Doku_Event_Handler' => DOKU_INC.'inc/events.php', 6416905344SAndreas Gohr 'EmailAddressValidator' => DOKU_INC.'inc/EmailAddressValidator.php', 6589177306SAndreas Gohr 'Input' => DOKU_INC.'inc/Input.class.php', 6616905344SAndreas Gohr 'JpegMeta' => DOKU_INC.'inc/JpegMeta.php', 672dcde304SAndreas Gohr 'SimplePie' => DOKU_INC.'inc/SimplePie.php', 6816905344SAndreas Gohr 'FeedParser' => DOKU_INC.'inc/FeedParser.php', 6916905344SAndreas Gohr 'IXR_Server' => DOKU_INC.'inc/IXR_Library.php', 7016905344SAndreas Gohr 'IXR_Client' => DOKU_INC.'inc/IXR_Library.php', 715ce4ea15SMichael Klier 'IXR_IntrospectionServer' => DOKU_INC.'inc/IXR_Library.php', 7216905344SAndreas Gohr 'Doku_Plugin_Controller'=> DOKU_INC.'inc/plugincontroller.class.php', 7316905344SAndreas Gohr 'GeSHi' => DOKU_INC.'inc/geshi.php', 742dcde304SAndreas Gohr 'TarLib' => DOKU_INC.'inc/TarLib.class.php', 7594d621b0SAdrian Lang 'ZipLib' => DOKU_INC.'inc/ZipLib.class.php', 7605ed2c25SAndreas Gohr 'DokuWikiFeedCreator' => DOKU_INC.'inc/feedcreator.class.php', 7705ed2c25SAndreas Gohr 'Doku_Parser_Mode' => DOKU_INC.'inc/parser/parser.php', 78f03fd957SAndreas Gohr 'SafeFN' => DOKU_INC.'inc/SafeFN.class.php', 792897eb23SMichael Hamann 'Sitemapper' => DOKU_INC.'inc/Sitemapper.php', 803a0a2d05SAndreas Gohr 'PassHash' => DOKU_INC.'inc/PassHash.class.php', 81c9a53c46SAndreas Gohr 'Mailer' => DOKU_INC.'inc/Mailer.class.php', 82457ad80aSDominik Eckelmann 'RemoteAPI' => DOKU_INC.'inc/remote.php', 83b967e5fcSDominik Eckelmann 'RemoteAPICore' => DOKU_INC.'inc/RemoteAPICore.php', 84c2a6d816SAndreas Gohr 85c2a6d816SAndreas Gohr 'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php', 86c2a6d816SAndreas Gohr 'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php', 87c2a6d816SAndreas Gohr 'DokuWiki_Syntax_Plugin' => DOKU_PLUGIN.'syntax.php', 88457ad80aSDominik Eckelmann 'DokuWiki_Remote_Plugin' => DOKU_PLUGIN.'remote.php', 893cbcc653SJan Schumann 'DokuWiki_Auth_Plugin' => DOKU_PLUGIN.'auth.php', 90c2a6d816SAndreas Gohr 9116905344SAndreas Gohr ); 9216905344SAndreas Gohr 9316905344SAndreas Gohr if(isset($classes[$name])){ 9416905344SAndreas Gohr require_once($classes[$name]); 9516905344SAndreas Gohr return; 9616905344SAndreas Gohr } 97d54ac877SAdrian Lang 98d54ac877SAdrian Lang // Plugin loading 99*93a7873eSAndreas Gohr if(preg_match('/^(auth|helper|syntax|action|admin|renderer|remote)_plugin_('.DOKU_PLUGIN_NAME_REGEX.')(?:_([^_]+))?$/', 100d54ac877SAdrian Lang $name, $m)) { 101d54ac877SAdrian Lang // try to load the wanted plugin file 102d54ac877SAdrian Lang $c = ((count($m) === 4) ? "/{$m[3]}" : ''); 1035a9866e9SAndreas Gohr $plg = DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php"; 1045a9866e9SAndreas Gohr if(@file_exists($plg)){ 10592faea0eSMichael Hamann include_once DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php"; 1065a9866e9SAndreas Gohr } 107d54ac877SAdrian Lang return; 108d54ac877SAdrian Lang } 10916905344SAndreas Gohr} 11016905344SAndreas Gohr 111