|
|
|
|
|
|
|
|
private static $_classMap = []; |
|
|
private static $_classMap = []; |
|
|
private static $_registered = false; |
|
|
private static $_registered = false; |
|
|
|
|
|
|
|
|
|
|
|
private static $test_class_not_found = [] ; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Import namespace |
|
|
* Import namespace |
|
|
* ``` |
|
|
* ``` |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
public static function load($class) |
|
|
public static function load($class) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if(!isset(static::$test_class_not_found[$class])) |
|
|
|
|
|
static::$test_class_not_found[$class] = 0 ; |
|
|
|
|
|
|
|
|
|
|
|
static::$test_class_not_found[$class] ++ ; |
|
|
|
|
|
|
|
|
|
|
|
if(static::$test_class_not_found[$class] > 30) { |
|
|
|
|
|
throw new \yii\base\ErrorException('Class not found : '.$class) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (empty(static::$_paths) && empty(static::$_classMap)) { |
|
|
if (empty(static::$_paths) && empty(static::$_classMap)) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |