Separate the Special:Preferences title and the link to the preferences from the perso...
[lhc/web/wiklou.git] / includes / AutoLoader.php
index ae9acbf..63ac24b 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
 /* This defines autoloading handler for whole MediaWiki framework */
+
+ini_set('unserialize_callback_func', '__autoload' );
+
 function __autoload($className) {
        global $wgAutoloadClasses;
 
@@ -19,11 +22,13 @@ function __autoload($className) {
                'Block' => 'includes/Block.php',
                'CacheManager' => 'includes/CacheManager.php',
                'CategoryPage' => 'includes/CategoryPage.php',
+               'CategoryViewer' => 'includes/CategoryPage.php',
                'Categoryfinder' => 'includes/Categoryfinder.php',
                'RCCacheEntry' => 'includes/ChangesList.php',
                'ChangesList' => 'includes/ChangesList.php',
                'OldChangesList' => 'includes/ChangesList.php',
                'EnhancedChangesList' => 'includes/ChangesList.php',
+               'CoreParserFunctions' => 'includes/CoreParserFunctions.php',
                'DBObject' => 'includes/Database.php',
                'Database' => 'includes/Database.php',
                'DatabaseMysql' => 'includes/Database.php',
@@ -83,7 +88,9 @@ function __autoload($className) {
                'HistoryBlobCurStub' => 'includes/HistoryBlob.php',
                'HTMLCacheUpdate' => 'includes/HTMLCacheUpdate.php',
                'HTMLCacheUpdateJob' => 'includes/HTMLCacheUpdate.php',
+               'Http' => 'includes/HttpFunctions.php',
                'Image' => 'includes/Image.php',
+               'IP' => 'includes/IP.php',
                'ThumbnailImage' => 'includes/Image.php',
                'ImageGallery' => 'includes/ImageGallery.php',
                'ImagePage' => 'includes/ImagePage.php',
@@ -106,20 +113,18 @@ function __autoload($className) {
                'MimeMagic' => 'includes/MimeMagic.php',
                'Namespace' => 'includes/Namespace.php',
                'FakeMemCachedClient' => 'includes/ObjectCache.php',
-               'ObjectCacheManager' => 'includes/ObjectCache.php',
-               'MemCachedClientforWiki' => 'includes/ObjectCache.php',
                'OutputPage' => 'includes/OutputPage.php',
                'PageHistory' => 'includes/PageHistory.php',
+               'IndexPager' => 'includes/Pager.php',
+               'ReverseChronologicalPager' => 'includes/Pager.php',
+               'TablePager' => 'includes/Pager.php',
                'Parser' => 'includes/Parser.php',
                'ParserOutput' => 'includes/Parser.php',
                'ParserOptions' => 'includes/Parser.php',
                'ParserCache' => 'includes/ParserCache.php',
-               'element' => 'includes/ParserXML.php',
-               'xml2php' => 'includes/ParserXML.php',
-               'ParserXML' => 'includes/ParserXML.php',
                'ProfilerSimple' => 'includes/ProfilerSimple.php',
                'ProfilerSimpleUDP' => 'includes/ProfilerSimpleUDP.php',
-               'Profiler' => 'includes/Profiling.php',
+               'Profiler' => 'includes/Profiler.php',
                'ProxyTools' => 'includes/ProxyTools.php',
                'ProtectionForm' => 'includes/ProtectionForm.php',
                'QueryPage' => 'includes/QueryPage.php',
@@ -135,7 +140,7 @@ function __autoload($className) {
                'SearchMySQL' => 'includes/SearchMySQL.php',
                'MySQLSearchResultSet' => 'includes/SearchMySQL.php',
                'SearchMySQL4' => 'includes/SearchMySQL4.php',
-               'SearchTsearch2' => 'includes/SearchTsearch2.php',
+               'SearchPostgres' => 'includes/SearchPostgres.php',
                'SearchUpdate' => 'includes/SearchUpdate.php',
                'SearchUpdateMyISAM' => 'includes/SearchUpdate.php',
                'SiteConfiguration' => 'includes/SiteConfiguration.php',
@@ -210,25 +215,43 @@ function __autoload($className) {
                'EmailNotification' => 'includes/UserMailer.php',
                'WatchedItem' => 'includes/WatchedItem.php',
                'WebRequest' => 'includes/WebRequest.php',
+               'WebResponse' => 'includes/WebResponse.php',
                'FauxRequest' => 'includes/WebRequest.php',
                'MediaWiki' => 'includes/Wiki.php',
                'WikiError' => 'includes/WikiError.php',
                'WikiErrorMsg' => 'includes/WikiError.php',
                'WikiXmlError' => 'includes/WikiError.php',
+               'Xml' => 'includes/Xml.php',
                'ZhClient' => 'includes/ZhClient.php',
                'memcached' => 'includes/memcached-client.php',
-               'UtfNormal' => 'includes/normal/UtfNormal.php'
+               'UtfNormal' => 'includes/normal/UtfNormal.php',
+               'UsercreateTemplate' => 'includes/templates/Userlogin.php',
+               'UserloginTemplate' => 'includes/templates/Userlogin.php',
+               'Language' => 'languages/Language.php',
        );
        if ( isset( $localClasses[$className] ) ) {
                $filename = $localClasses[$className];
        } elseif ( isset( $wgAutoloadClasses[$className] ) ) {
                $filename = $wgAutoloadClasses[$className];
        } else {
-               return;
+               # Try a different capitalisation
+               # The case can sometimes be wrong when unserializing PHP 4 objects
+               $filename = false;
+               $lowerClass = strtolower( $className );
+               foreach ( $localClasses as $class2 => $file2 ) {
+                       if ( strtolower( $class2 ) == $lowerClass ) {
+                               $filename = $file2;
+                       }
+               }
+               if ( !$filename ) {
+                       # Give up
+                       return;
+               }
        }
 
        # Make an absolute path, this improves performance by avoiding some stat calls
-       if ( substr( $filename, 0, 1 ) == '/' || substr( $filename, 1, 1 ) == ':' ) {
+       if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) {
+               global $IP;
                $filename = "$IP/$filename";
        }
        require( $filename );