Browse Source

cleanup YiiBase::autoload()

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
293b1737e1
  1. 7
      framework/yii/YiiBase.php

7
framework/yii/YiiBase.php

@ -353,11 +353,10 @@ class YiiBase
$path = str_replace('_', '/', $className) . '.php'; $path = str_replace('_', '/', $className) . '.php';
} }
// try via path alias first // try loading via path alias
if (strpos($path, '/') !== false) { if (strpos($path, '/') !== false) {
$fullPath = static::getAlias('@' . $path, false); $classFile = static::getAlias('@' . $path, false);
if ($fullPath !== false && is_file($fullPath)) { if ($classFile !== false && is_file($classFile)) {
$classFile = $fullPath;
include($classFile); include($classFile);
} }
} }

Loading…
Cancel
Save