* Split most of the result output code from QueryPage::doQuery() into QueryPage:...
[lhc/web/wiklou.git] / includes / AutoLoader.php
1 <?php
2
3 /* This defines autoloading handler for whole MediaWiki framework */
4
5 ini_set('unserialize_callback_func', '__autoload' );
6
7 function __autoload($className) {
8 global $wgAutoloadClasses;
9
10 static $localClasses = array(
11 'AjaxDispatcher' => 'includes/AjaxDispatcher.php',
12 'AjaxCachePolicy' => 'includes/AjaxFunctions.php',
13 'AjaxResponse' => 'includes/AjaxResponse.php',
14 'AlphabeticPager' => 'includes/Pager.php',
15 'Article' => 'includes/Article.php',
16 'AuthPlugin' => 'includes/AuthPlugin.php',
17 'BagOStuff' => 'includes/BagOStuff.php',
18 'HashBagOStuff' => 'includes/BagOStuff.php',
19 'SqlBagOStuff' => 'includes/BagOStuff.php',
20 'MediaWikiBagOStuff' => 'includes/BagOStuff.php',
21 'TurckBagOStuff' => 'includes/BagOStuff.php',
22 'APCBagOStuff' => 'includes/BagOStuff.php',
23 'eAccelBagOStuff' => 'includes/BagOStuff.php',
24 'DBABagOStuff' => 'includes/BagOStuff.php',
25 'Block' => 'includes/Block.php',
26 'HTMLFileCache' => 'includes/HTMLFileCache.php',
27 'DependencyWrapper' => 'includes/CacheDependency.php',
28 'FileDependency' => 'includes/CacheDependency.php',
29 'TitleDependency' => 'includes/CacheDependency.php',
30 'TitleListDependency' => 'includes/CacheDependency.php',
31 'CategoryPage' => 'includes/CategoryPage.php',
32 'CategoryViewer' => 'includes/CategoryPage.php',
33 'Categoryfinder' => 'includes/Categoryfinder.php',
34 'RCCacheEntry' => 'includes/ChangesList.php',
35 'ChangesList' => 'includes/ChangesList.php',
36 'OldChangesList' => 'includes/ChangesList.php',
37 'EnhancedChangesList' => 'includes/ChangesList.php',
38 'CoreParserFunctions' => 'includes/CoreParserFunctions.php',
39 'DBObject' => 'includes/Database.php',
40 'Database' => 'includes/Database.php',
41 'DatabaseMysql' => 'includes/Database.php',
42 'ResultWrapper' => 'includes/Database.php',
43 'DatabasePostgres' => 'includes/DatabasePostgres.php',
44 'DatabaseOracle' => 'includes/DatabaseOracle.php',
45 'DateFormatter' => 'includes/DateFormatter.php',
46 'DifferenceEngine' => 'includes/DifferenceEngine.php',
47 '_DiffOp' => 'includes/DifferenceEngine.php',
48 '_DiffOp_Copy' => 'includes/DifferenceEngine.php',
49 '_DiffOp_Delete' => 'includes/DifferenceEngine.php',
50 '_DiffOp_Add' => 'includes/DifferenceEngine.php',
51 '_DiffOp_Change' => 'includes/DifferenceEngine.php',
52 '_DiffEngine' => 'includes/DifferenceEngine.php',
53 'Diff' => 'includes/DifferenceEngine.php',
54 'MappedDiff' => 'includes/DifferenceEngine.php',
55 'DiffFormatter' => 'includes/DifferenceEngine.php',
56 'DjVuImage' => 'includes/DjVuImage.php',
57 '_HWLDF_WordAccumulator' => 'includes/DifferenceEngine.php',
58 'WordLevelDiff' => 'includes/DifferenceEngine.php',
59 'TableDiffFormatter' => 'includes/DifferenceEngine.php',
60 'EditPage' => 'includes/EditPage.php',
61 'MWException' => 'includes/Exception.php',
62 'Exif' => 'includes/Exif.php',
63 'FormatExif' => 'includes/Exif.php',
64 'WikiExporter' => 'includes/Export.php',
65 'XmlDumpWriter' => 'includes/Export.php',
66 'DumpOutput' => 'includes/Export.php',
67 'DumpFileOutput' => 'includes/Export.php',
68 'DumpPipeOutput' => 'includes/Export.php',
69 'DumpGZipOutput' => 'includes/Export.php',
70 'DumpBZip2Output' => 'includes/Export.php',
71 'Dump7ZipOutput' => 'includes/Export.php',
72 'DumpFilter' => 'includes/Export.php',
73 'DumpNotalkFilter' => 'includes/Export.php',
74 'DumpNamespaceFilter' => 'includes/Export.php',
75 'DumpLatestFilter' => 'includes/Export.php',
76 'DumpMultiWriter' => 'includes/Export.php',
77 'ExternalEdit' => 'includes/ExternalEdit.php',
78 'ExternalStore' => 'includes/ExternalStore.php',
79 'ExternalStoreDB' => 'includes/ExternalStoreDB.php',
80 'ExternalStoreHttp' => 'includes/ExternalStoreHttp.php',
81 'FakeTitle' => 'includes/FakeTitle.php',
82 'FeedItem' => 'includes/Feed.php',
83 'ChannelFeed' => 'includes/Feed.php',
84 'RSSFeed' => 'includes/Feed.php',
85 'AtomFeed' => 'includes/Feed.php',
86 'FileStore' => 'includes/FileStore.php',
87 'FSException' => 'includes/FileStore.php',
88 'FSTransaction' => 'includes/FileStore.php',
89 'HTMLForm' => 'includes/HTMLForm.php',
90 'HistoryBlob' => 'includes/HistoryBlob.php',
91 'ConcatenatedGzipHistoryBlob' => 'includes/HistoryBlob.php',
92 'HistoryBlobStub' => 'includes/HistoryBlob.php',
93 'HistoryBlobCurStub' => 'includes/HistoryBlob.php',
94 'HTMLCacheUpdate' => 'includes/HTMLCacheUpdate.php',
95 'HTMLCacheUpdateJob' => 'includes/HTMLCacheUpdate.php',
96 'Http' => 'includes/HttpFunctions.php',
97 'Image' => 'includes/Image.php',
98 'ArchivedFile' => 'includes/Image.php',
99 'IP' => 'includes/IP.php',
100 'ThumbnailImage' => 'includes/Image.php',
101 'ImageGallery' => 'includes/ImageGallery.php',
102 'ImagePage' => 'includes/ImagePage.php',
103 'ImageHistoryList' => 'includes/ImagePage.php',
104 'ImageRemote' => 'includes/ImageRemote.php',
105 'Job' => 'includes/JobQueue.php',
106 'Licenses' => 'includes/Licenses.php',
107 'License' => 'includes/Licenses.php',
108 'LinkBatch' => 'includes/LinkBatch.php',
109 'LinkCache' => 'includes/LinkCache.php',
110 'LinkFilter' => 'includes/LinkFilter.php',
111 'Linker' => 'includes/Linker.php',
112 'LinksUpdate' => 'includes/LinksUpdate.php',
113 'LoadBalancer' => 'includes/LoadBalancer.php',
114 'LogPage' => 'includes/LogPage.php',
115 'MacBinary' => 'includes/MacBinary.php',
116 'MagicWord' => 'includes/MagicWord.php',
117 'MathRenderer' => 'includes/Math.php',
118 'MessageCache' => 'includes/MessageCache.php',
119 'MimeMagic' => 'includes/MimeMagic.php',
120 'Namespace' => 'includes/Namespace.php',
121 'FakeMemCachedClient' => 'includes/ObjectCache.php',
122 'OutputPage' => 'includes/OutputPage.php',
123 'PageHistory' => 'includes/PageHistory.php',
124 'IndexPager' => 'includes/Pager.php',
125 'ReverseChronologicalPager' => 'includes/Pager.php',
126 'TablePager' => 'includes/Pager.php',
127 'Parser' => 'includes/Parser.php',
128 'ParserOutput' => 'includes/ParserOutput.php',
129 'ParserOptions' => 'includes/ParserOptions.php',
130 'ParserCache' => 'includes/ParserCache.php',
131 'ProfilerSimple' => 'includes/ProfilerSimple.php',
132 'ProfilerSimpleUDP' => 'includes/ProfilerSimpleUDP.php',
133 'Profiler' => 'includes/Profiler.php',
134 'ProxyTools' => 'includes/ProxyTools.php',
135 'ProtectionForm' => 'includes/ProtectionForm.php',
136 'QueryPage' => 'includes/QueryPage.php',
137 'PageQueryPage' => 'includes/QueryPage.php',
138 'ImageQueryPage' => 'includes/ImageQueryPage.php',
139 'RawPage' => 'includes/RawPage.php',
140 'RecentChange' => 'includes/RecentChange.php',
141 'Revision' => 'includes/Revision.php',
142 'Sanitizer' => 'includes/Sanitizer.php',
143 'SearchEngine' => 'includes/SearchEngine.php',
144 'SearchResultSet' => 'includes/SearchEngine.php',
145 'SearchResult' => 'includes/SearchEngine.php',
146 'SearchEngineDummy' => 'includes/SearchEngine.php',
147 'SearchMySQL' => 'includes/SearchMySQL.php',
148 'MySQLSearchResultSet' => 'includes/SearchMySQL.php',
149 'SearchMySQL4' => 'includes/SearchMySQL4.php',
150 'SearchPostgres' => 'includes/SearchPostgres.php',
151 'SearchUpdate' => 'includes/SearchUpdate.php',
152 'SearchUpdateMyISAM' => 'includes/SearchUpdate.php',
153 'SearchOracle' => 'includes/SearchOracle.php',
154 'SiteConfiguration' => 'includes/SiteConfiguration.php',
155 'SiteStats' => 'includes/SiteStats.php',
156 'SiteStatsUpdate' => 'includes/SiteStats.php',
157 'Skin' => 'includes/Skin.php',
158 'MediaWiki_I18N' => 'includes/SkinTemplate.php',
159 'SkinTemplate' => 'includes/SkinTemplate.php',
160 'QuickTemplate' => 'includes/SkinTemplate.php',
161 'SpecialAllpages' => 'includes/SpecialAllpages.php',
162 'AncientPagesPage' => 'includes/SpecialAncientpages.php',
163 'IPBlockForm' => 'includes/SpecialBlockip.php',
164 'SpecialBookSources' => 'includes/SpecialBooksources.php',
165 'BrokenRedirectsPage' => 'includes/SpecialBrokenRedirects.php',
166 'EmailConfirmation' => 'includes/SpecialConfirmemail.php',
167 'ContributionsPage' => 'includes/SpecialContributions.php',
168 'DeadendPagesPage' => 'includes/SpecialDeadendpages.php',
169 'DisambiguationsPage' => 'includes/SpecialDisambiguations.php',
170 'DoubleRedirectsPage' => 'includes/SpecialDoubleRedirects.php',
171 'EmailUserForm' => 'includes/SpecialEmailuser.php',
172 'WikiRevision' => 'includes/SpecialImport.php',
173 'WikiImporter' => 'includes/SpecialImport.php',
174 'ImportStringSource' => 'includes/SpecialImport.php',
175 'ImportStreamSource' => 'includes/SpecialImport.php',
176 'IPUnblockForm' => 'includes/SpecialIpblocklist.php',
177 'ListredirectsPage' => 'includes/SpecialListredirects.php',
178 'DBLockForm' => 'includes/SpecialLockdb.php',
179 'LogReader' => 'includes/SpecialLog.php',
180 'LogViewer' => 'includes/SpecialLog.php',
181 'LonelyPagesPage' => 'includes/SpecialLonelypages.php',
182 'LongPagesPage' => 'includes/SpecialLongpages.php',
183 'MIMEsearchPage' => 'includes/SpecialMIMEsearch.php',
184 'MostcategoriesPage' => 'includes/SpecialMostcategories.php',
185 'MostimagesPage' => 'includes/SpecialMostimages.php',
186 'MostlinkedPage' => 'includes/SpecialMostlinked.php',
187 'MostlinkedCategoriesPage' => 'includes/SpecialMostlinkedcategories.php',
188 'MostrevisionsPage' => 'includes/SpecialMostrevisions.php',
189 'MovePageForm' => 'includes/SpecialMovepage.php',
190 'NewbieContributionsPage' => 'includes/SpecialNewbieContributions.php',
191 'NewPagesPage' => 'includes/SpecialNewpages.php',
192 'SpecialPage' => 'includes/SpecialPage.php',
193 'UnlistedSpecialPage' => 'includes/SpecialPage.php',
194 'IncludableSpecialPage' => 'includes/SpecialPage.php',
195 'PopularPagesPage' => 'includes/SpecialPopularpages.php',
196 'PreferencesForm' => 'includes/SpecialPreferences.php',
197 'SpecialPrefixindex' => 'includes/SpecialPrefixindex.php',
198 'RevisionDeleteForm' => 'includes/SpecialRevisiondelete.php',
199 'RevisionDeleter' => 'includes/SpecialRevisiondelete.php',
200 'SpecialSearch' => 'includes/SpecialSearch.php',
201 'ShortPagesPage' => 'includes/SpecialShortpages.php',
202 'UncategorizedCategoriesPage' => 'includes/SpecialUncategorizedcategories.php',
203 'UncategorizedPagesPage' => 'includes/SpecialUncategorizedpages.php',
204 'PageArchive' => 'includes/SpecialUndelete.php',
205 'UndeleteForm' => 'includes/SpecialUndelete.php',
206 'DBUnlockForm' => 'includes/SpecialUnlockdb.php',
207 'UnusedCategoriesPage' => 'includes/SpecialUnusedcategories.php',
208 'UnusedimagesPage' => 'includes/SpecialUnusedimages.php',
209 'UnusedtemplatesPage' => 'includes/SpecialUnusedtemplates.php',
210 'UnwatchedpagesPage' => 'includes/SpecialUnwatchedpages.php',
211 'UploadForm' => 'includes/SpecialUpload.php',
212 'UploadFormMogile' => 'includes/SpecialUploadMogile.php',
213 'LoginForm' => 'includes/SpecialUserlogin.php',
214 'UserrightsForm' => 'includes/SpecialUserrights.php',
215 'SpecialVersion' => 'includes/SpecialVersion.php',
216 'WantedCategoriesPage' => 'includes/SpecialWantedcategories.php',
217 'WantedPagesPage' => 'includes/SpecialWantedpages.php',
218 'WhatLinksHerePage' => 'includes/SpecialWhatlinkshere.php',
219 'SquidUpdate' => 'includes/SquidUpdate.php',
220 'ReplacementArray' => 'includes/StringUtils.php',
221 'Replacer' => 'includes/StringUtils.php',
222 'RegexlikeReplacer' => 'includes/StringUtils.php',
223 'DoubleReplacer' => 'includes/StringUtils.php',
224 'HashtableReplacer' => 'includes/StringUtils.php',
225 'StringUtils' => 'includes/StringUtils.php',
226 'Title' => 'includes/Title.php',
227 'User' => 'includes/User.php',
228 'MailAddress' => 'includes/UserMailer.php',
229 'EmailNotification' => 'includes/UserMailer.php',
230 'WatchedItem' => 'includes/WatchedItem.php',
231 'WebRequest' => 'includes/WebRequest.php',
232 'WebResponse' => 'includes/WebResponse.php',
233 'FauxRequest' => 'includes/WebRequest.php',
234 'MediaWiki' => 'includes/Wiki.php',
235 'WikiError' => 'includes/WikiError.php',
236 'WikiErrorMsg' => 'includes/WikiError.php',
237 'WikiXmlError' => 'includes/WikiError.php',
238 'Xml' => 'includes/Xml.php',
239 'ZhClient' => 'includes/ZhClient.php',
240 'memcached' => 'includes/memcached-client.php',
241 'UtfNormal' => 'includes/normal/UtfNormal.php',
242 'UsercreateTemplate' => 'includes/templates/Userlogin.php',
243 'UserloginTemplate' => 'includes/templates/Userlogin.php',
244 'Language' => 'languages/Language.php',
245 'PasswordResetForm' => 'includes/SpecialResetpass.php',
246 'PatrolLog' => 'includes/PatrolLog.php',
247
248 // API classes
249 'ApiBase' => 'includes/api/ApiBase.php',
250 'ApiFormatFeedWrapper' => 'includes/api/ApiFormatBase.php',
251 'ApiFeedWatchlist' => 'includes/api/ApiFeedWatchlist.php',
252 'ApiFormatBase' => 'includes/api/ApiFormatBase.php',
253 'Services_JSON' => 'includes/api/ApiFormatJson_json.php',
254 'ApiFormatJson' => 'includes/api/ApiFormatJson.php',
255 'ApiFormatPhp' => 'includes/api/ApiFormatPhp.php',
256 'ApiFormatWddx' => 'includes/api/ApiFormatWddx.php',
257 'ApiFormatXml' => 'includes/api/ApiFormatXml.php',
258 'Spyc' => 'includes/api/ApiFormatYaml_spyc.php',
259 'ApiFormatYaml' => 'includes/api/ApiFormatYaml.php',
260 'ApiHelp' => 'includes/api/ApiHelp.php',
261 'ApiLogin' => 'includes/api/ApiLogin.php',
262 'ApiMain' => 'includes/api/ApiMain.php',
263 'ApiOpenSearch' => 'includes/api/ApiOpenSearch.php',
264 'ApiPageSet' => 'includes/api/ApiPageSet.php',
265 'ApiQuery' => 'includes/api/ApiQuery.php',
266 'ApiQueryAllpages' => 'includes/api/ApiQueryAllpages.php',
267 'ApiQueryBase' => 'includes/api/ApiQueryBase.php',
268 'ApiQueryBacklinks' => 'includes/api/ApiQueryBacklinks.php',
269 'ApiQueryContributions' => 'includes/api/ApiQueryUserContributions.php',
270 'ApiQueryInfo' => 'includes/api/ApiQueryInfo.php',
271 'ApiQueryLogEvents' => 'includes/api/ApiQueryLogEvents.php',
272 'ApiQueryRecentChanges'=> 'includes/api/ApiQueryRecentChanges.php',
273 'ApiQueryRevisions' => 'includes/api/ApiQueryRevisions.php',
274 'ApiQuerySiteinfo' => 'includes/api/ApiQuerySiteinfo.php',
275 'ApiQueryWatchlist' => 'includes/api/ApiQueryWatchlist.php',
276 'ApiResult' => 'includes/api/ApiResult.php',
277 );
278
279 wfProfileIn( __METHOD__ );
280 if ( isset( $localClasses[$className] ) ) {
281 $filename = $localClasses[$className];
282 } elseif ( isset( $wgAutoloadClasses[$className] ) ) {
283 $filename = $wgAutoloadClasses[$className];
284 } else {
285 # Try a different capitalisation
286 # The case can sometimes be wrong when unserializing PHP 4 objects
287 $filename = false;
288 $lowerClass = strtolower( $className );
289 foreach ( $localClasses as $class2 => $file2 ) {
290 if ( strtolower( $class2 ) == $lowerClass ) {
291 $filename = $file2;
292 }
293 }
294 if ( !$filename ) {
295 # Give up
296 wfProfileOut( __METHOD__ );
297 return;
298 }
299 }
300
301 # Make an absolute path, this improves performance by avoiding some stat calls
302 if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) {
303 global $IP;
304 $filename = "$IP/$filename";
305 }
306 require( $filename );
307 wfProfileOut( __METHOD__ );
308 }
309
310 function wfLoadAllExtensions() {
311 global $wgAutoloadClasses;
312
313 # It is crucial that SpecialPage.php is included before any special page
314 # extensions are loaded. Otherwise the parent class will not be available
315 # when APC loads the early-bound extension class. Normally this is
316 # guaranteed by entering special pages via SpecialPage members such as
317 # executePath(), but here we have to take a more explicit measure.
318
319 require_once( dirname(__FILE__) . '/SpecialPage.php' );
320
321 foreach( $wgAutoloadClasses as $class => $file ) {
322 if( !( class_exists( $class ) || interface_exists( $class ) ) ) {
323 require( $file );
324 }
325 }
326 }
327
328 ?>