Revert part of r44296 "*Skip autoloading of skin, always does inefficient strtolower...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Dec 2008 23:39:02 +0000 (23:39 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Dec 2008 23:39:02 +0000 (23:39 +0000)
Unless there's some really huge overriding reason to do this, there's no point poking around in the autoloader's guts to try to outsmart it. Just let it take a few nanoseconds to check its array and don't add yourself a dependency on its implementation details.
If there *is* some really huge overriding reason to complicate the code, please provide some data supporting it.

includes/Skin.php

index 03d6dd2..90a6b77 100644 (file)
@@ -123,7 +123,7 @@ class Skin extends Linker {
         * @static
         */
        static function &newFromKey( $key ) {
-               global $wgStyleDirectory, $wgAutoloadClasses;
+               global $wgStyleDirectory;
 
                $key = Skin::normalizeKey( $key );
 
@@ -132,8 +132,7 @@ class Skin extends Linker {
                $className = 'Skin'.ucfirst($key);
 
                # Grab the skin class and initialise it.
-               # Use autoloader if it is set in $wgAutoloadClasses.
-               if( !class_exists( $className, isset($wgAutoloadClasses[$className]) ) ) {
+               if ( !class_exists( $className ) ) {
                        // Preload base classes to work around APC/PHP5 bug
                        $deps = "{$wgStyleDirectory}/{$skinName}.deps.php";
                        if( file_exists( $deps ) ) include_once( $deps );