From: Brion Vibber Date: Wed, 10 Dec 2008 23:39:02 +0000 (+0000) Subject: Revert part of r44296 "*Skip autoloading of skin, always does inefficient strtolower... X-Git-Tag: 1.31.0-rc.0~44049 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=53a98ef3fba62044e8b07754676104772b07b151;p=lhc%2Fweb%2Fwiklou.git Revert part of r44296 "*Skip autoloading of skin, always does inefficient strtolower() stuff and fails (returns false) anyway" and r44302 "Tweak r44296: use autoloader if it is set there". 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. --- diff --git a/includes/Skin.php b/includes/Skin.php index 03d6dd2764..90a6b77c69 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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 );