Skip to content
Newer
Older
100644 108 lines (99 sloc) 4.54 KB
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
1 <?php
2 /**
3 * Load all internal libraries and setup class autoloader
4 *
5 * @author Andreas Gohr <andi@splitbrain.org>
6 */
7
8 // setup class autoloader
9 spl_autoload_register('load_autoload');
10
11 // require all the common libraries
05ed2c2 @splitbrain some more load fixes
authored Mar 12, 2010
12 // for a few of these order does matter
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
13 require_once(DOKU_INC.'inc/blowfish.php');
14 require_once(DOKU_INC.'inc/actions.php');
15 require_once(DOKU_INC.'inc/changelog.php');
16 require_once(DOKU_INC.'inc/common.php');
17 require_once(DOKU_INC.'inc/confutils.php');
18 require_once(DOKU_INC.'inc/pluginutils.php');
19 require_once(DOKU_INC.'inc/plugin.php');
20 require_once(DOKU_INC.'inc/events.php');
21 require_once(DOKU_INC.'inc/form.php');
22 require_once(DOKU_INC.'inc/fulltext.php');
23 require_once(DOKU_INC.'inc/html.php');
24 require_once(DOKU_INC.'inc/httputils.php');
25 require_once(DOKU_INC.'inc/indexer.php');
26 require_once(DOKU_INC.'inc/infoutils.php');
27 require_once(DOKU_INC.'inc/io.php');
28 require_once(DOKU_INC.'inc/mail.php');
29 require_once(DOKU_INC.'inc/media.php');
30 require_once(DOKU_INC.'inc/pageutils.php');
31 require_once(DOKU_INC.'inc/parserutils.php');
32 require_once(DOKU_INC.'inc/search.php');
33 require_once(DOKU_INC.'inc/subscription.php');
34 require_once(DOKU_INC.'inc/template.php');
35 require_once(DOKU_INC.'inc/toolbar.php');
36 require_once(DOKU_INC.'inc/utf8.php');
37 require_once(DOKU_INC.'inc/auth.php');
38
39 /**
40 * spl_autoload_register callback
41 *
42 * Contains a static list of DokuWiki's core classes and automatically
2dcde30 @splitbrain do not autorequire class only libraries
authored Feb 1, 2010
43 * require()s their associated php files when an object is instantiated.
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
44 *
45 * @author Andreas Gohr <andi@splitbrain.org>
d54ac87 @adrianheine Use autoloading for plugin classes
adrianheine authored Jun 6, 2011
46 * @todo add generic loading of renderers and auth backends
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
47 */
48 function load_autoload($name){
49 static $classes = null;
50 if(is_null($classes)) $classes = array(
51 'DokuHTTPClient' => DOKU_INC.'inc/HTTPClient.php',
a1d9de5 @splitbrain make HTTPClient loadable via autoloader
authored Apr 26, 2012
52 'HTTPClient' => DOKU_INC.'inc/HTTPClient.php',
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
53 'JSON' => DOKU_INC.'inc/JSON.php',
54 'adLDAP' => DOKU_INC.'inc/adLDAP.php',
55 'Diff' => DOKU_INC.'inc/DifferenceEngine.php',
56 'UnifiedDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php',
57 'TableDiffFormatter' => DOKU_INC.'inc/DifferenceEngine.php',
58 'cache' => DOKU_INC.'inc/cache.php',
59 'cache_parser' => DOKU_INC.'inc/cache.php',
60 'cache_instructions' => DOKU_INC.'inc/cache.php',
61 'cache_renderer' => DOKU_INC.'inc/cache.php',
62 'Doku_Event' => DOKU_INC.'inc/events.php',
63 'Doku_Event_Handler' => DOKU_INC.'inc/events.php',
64 'EmailAddressValidator' => DOKU_INC.'inc/EmailAddressValidator.php',
65 'JpegMeta' => DOKU_INC.'inc/JpegMeta.php',
2dcde30 @splitbrain do not autorequire class only libraries
authored Feb 1, 2010
66 'SimplePie' => DOKU_INC.'inc/SimplePie.php',
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
67 'FeedParser' => DOKU_INC.'inc/FeedParser.php',
68 'IXR_Server' => DOKU_INC.'inc/IXR_Library.php',
69 'IXR_Client' => DOKU_INC.'inc/IXR_Library.php',
5ce4ea1 added missing IXR_IntrospectionServer to autoload classes
Michael Klier authored Mar 16, 2010
70 'IXR_IntrospectionServer' => DOKU_INC.'inc/IXR_Library.php',
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
71 'Doku_Plugin_Controller'=> DOKU_INC.'inc/plugincontroller.class.php',
72 'GeSHi' => DOKU_INC.'inc/geshi.php',
2dcde30 @splitbrain do not autorequire class only libraries
authored Feb 1, 2010
73 'TarLib' => DOKU_INC.'inc/TarLib.class.php',
94d621b @adrianheine Typo in ZipLib autoloader
adrianheine authored Mar 16, 2010
74 'ZipLib' => DOKU_INC.'inc/ZipLib.class.php',
05ed2c2 @splitbrain some more load fixes
authored Mar 12, 2010
75 'DokuWikiFeedCreator' => DOKU_INC.'inc/feedcreator.class.php',
76 'Doku_Parser_Mode' => DOKU_INC.'inc/parser/parser.php',
f03fd95 @splitbrain new fnencode option FS#1649
authored Apr 4, 2010
77 'SafeFN' => DOKU_INC.'inc/SafeFN.class.php',
2897eb2 @michitux Transformed the sitemapper into a class
michitux authored Jun 26, 2010
78 'Sitemapper' => DOKU_INC.'inc/Sitemapper.php',
3a0a2d0 @splitbrain refactored passowrd hashing functions to a class
authored Jan 22, 2011
79 'PassHash' => DOKU_INC.'inc/PassHash.class.php',
c9a53c4 @splitbrain added Mailer class to autoloader
authored Nov 12, 2011
80 'Mailer' => DOKU_INC.'inc/Mailer.class.php',
457ad80 @dom-mel introduced remote api class
dom-mel authored Nov 23, 2011
81 'RemoteAPI' => DOKU_INC.'inc/remote.php',
ae7c596 @splitbrain Merge branch 'master' into htmlmail
authored Apr 15, 2012
82 'RemoteAPICore' => DOKU_INC.'inc/RemoteAPICore.php',
c2a6d81 @splitbrain plugin related autoloading
authored Feb 1, 2010
83
84 'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php',
85 'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php',
86 'DokuWiki_Syntax_Plugin' => DOKU_PLUGIN.'syntax.php',
457ad80 @dom-mel introduced remote api class
dom-mel authored Nov 23, 2011
87 'DokuWiki_Remote_Plugin' => DOKU_PLUGIN.'remote.php',
c2a6d81 @splitbrain plugin related autoloading
authored Feb 1, 2010
88
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
89 );
90
91 if(isset($classes[$name])){
92 require_once($classes[$name]);
93 return;
94 }
d54ac87 @adrianheine Use autoloading for plugin classes
adrianheine authored Jun 6, 2011
95
96 // Plugin loading
a4e0e79 @dom-mel enabled remote as plugintype
dom-mel authored Nov 19, 2011
97 if(preg_match('/^(helper|syntax|action|admin|renderer|remote)_plugin_([^_]+)(?:_([^_]+))?$/',
d54ac87 @adrianheine Use autoloading for plugin classes
adrianheine authored Jun 6, 2011
98 $name, $m)) {
99 //try to load the wanted plugin file
100 // include, but be silent. Maybe some other autoloader has an idea
101 // how to load this class.
102 $c = ((count($m) === 4) ? "/{$m[3]}" : '');
103 @include DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
104 return;
105 }
1690534 @splitbrain first attempt to centralize all include loading
authored Jan 31, 2010
106 }
107
Something went wrong with that request. Please try again.