关于yii 的baseyii.php的autoload方法
<br /> public static function autoload($className)<br /> {<br /> if (isset(static::$classMap[$className])) {<br /> $classFile = static::$classMap[$className];<br /> if ($classFile[0] === '@') {<br /> $classFile = static::getAlias($classFile);<br /> }<br /> } elseif (strpos($className, '\\') !== false) {<br /> $classFile = static::getAlias('@' . str_replace('\\', '/', $className) . '.php', false);<br /> if ($classFile === false || !is_file($classFile)) {<br /> return;<br /> }<br /> } else {<br /> return;<br /> }<br /><br /> include($classFile); //源码 include($classFile);<br /><br /> if (YII_DEBUG && !class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) {<br /> throw new UnknownClassException("Unable to find '$className' in file: $classFile. Namespace missing?");<br /> }<br /> }<br />