r44435 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44434‎ | r44435 | r44436 >
Date:23:39, 10 December 2008
Author:brion
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -123,7 +123,7 @@
124124 * @static
125125 */
126126 static function &newFromKey( $key ) {
127 - global $wgStyleDirectory, $wgAutoloadClasses;
 127+ global $wgStyleDirectory;
128128
129129 $key = Skin::normalizeKey( $key );
130130
@@ -132,8 +132,7 @@
133133 $className = 'Skin'.ucfirst($key);
134134
135135 # Grab the skin class and initialise it.
136 - # Use autoloader if it is set in $wgAutoloadClasses.
137 - if( !class_exists( $className, isset($wgAutoloadClasses[$className]) ) ) {
 136+ if ( !class_exists( $className ) ) {
138137 // Preload base classes to work around APC/PHP5 bug
139138 $deps = "{$wgStyleDirectory}/{$skinName}.deps.php";
140139 if( file_exists( $deps ) ) include_once( $deps );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44296*Skip autoloading of skin, always does inefficient strtolower() stuff and fai...aaron00:35, 8 December 2008
r44302Tweak r44296: use autoloader if it is set thereaaron11:48, 8 December 2008

Status & tagging log