From 882a611666b182471d69c9e1a9f2ad3fff8a98d4 Mon Sep 17 00:00:00 2001 From: Suralc Date: Thu, 9 May 2013 13:44:37 +0200 Subject: [PATCH] Removed static variable from autoload per qiangxue's suggestion --- framework/YiiBase.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/framework/YiiBase.php b/framework/YiiBase.php index a37c913..0618c2b 100644 --- a/framework/YiiBase.php +++ b/framework/YiiBase.php @@ -332,11 +332,6 @@ class YiiBase */ public static function autoload($className) { - static $hasTraitFunctionality; - if($hasTraitFunctionality === null) { - $hasTraitFunctionality = function_exists('trait_exists'); - } - $className = ltrim($className, '\\'); if (isset(self::$classMap[$className])) { @@ -376,7 +371,7 @@ class YiiBase 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");