Skip to content

Commit

Permalink
Removed static variable from autoload per qiangxue's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
suralc committed May 9, 2013
1 parent bac5c0e commit 882a611
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions framework/YiiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,6 @@ public static function setAlias($alias, $path)
*/
public static function autoload($className)
{
static $hasTraitFunctionality;
if($hasTraitFunctionality === null) {
$hasTraitFunctionality = function_exists('trait_exists');
}

$className = ltrim($className, '\\');

if (isset(self::$classMap[$className])) {
Expand Down Expand Up @@ -376,7 +371,7 @@ public static function autoload($className)
include($classFile);

if (class_exists($className, false) || interface_exists($className, false) ||
($hasTraitFunctionality === true && trait_exists($className, false))) {
function_exists('trait_exists') && trait_exists($className, false)) {
return true;
} else {
throw new UnknownClassException("Unable to find '$className' in file: $classFile");
Expand Down

0 comments on commit 882a611

Please sign in to comment.