Commit 411f373a by Qiang Xue

Merge pull request #742 from cebe/autoload

Fixed autoloader behavior according to leading \
parents 17cf3b5e c4587de5
...@@ -341,15 +341,13 @@ class YiiBase ...@@ -341,15 +341,13 @@ class YiiBase
* 4. Search PHP include_path for the actual class file if [[enableIncludePath]] is true; * 4. Search PHP include_path for the actual class file if [[enableIncludePath]] is true;
* 5. Return false so that other autoloaders have chance to include the class file. * 5. Return false so that other autoloaders have chance to include the class file.
* *
* @param string $className class name * @param string $className the fully qualified class name without leading \
* @return boolean whether the class has been loaded successfully * @return boolean whether the class has been loaded successfully
* @throws InvalidConfigException if the class file does not exist * @throws InvalidConfigException if the class file does not exist
* @throws UnknownClassException if the class does not exist in the class file * @throws UnknownClassException if the class does not exist in the class file
*/ */
public static function autoload($className) public static function autoload($className)
{ {
$className = ltrim($className, '\\');
if (isset(self::$classMap[$className])) { if (isset(self::$classMap[$className])) {
$classFile = self::$classMap[$className]; $classFile = self::$classMap[$className];
if ($classFile[0] === '@') { if ($classFile[0] === '@') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment