Tweak r44296: use autoloader if it is set there
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 8 Dec 2008 11:48:08 +0000 (11:48 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 8 Dec 2008 11:48:08 +0000 (11:48 +0000)
includes/Skin.php

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