mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #4501: Renamed the constant YII_PATH
to YII2_PATH
This commit is contained in:
@ -23,17 +23,17 @@ class ClassmapController extends Controller
|
||||
|
||||
/**
|
||||
* Creates a class map for the core Yii classes.
|
||||
* @param string $root the root path of Yii framework. Defaults to YII_PATH.
|
||||
* @param string $mapFile the file to contain the class map. Defaults to YII_PATH . '/classes.php'.
|
||||
* @param string $root the root path of Yii framework. Defaults to YII2_PATH.
|
||||
* @param string $mapFile the file to contain the class map. Defaults to YII2_PATH . '/classes.php'.
|
||||
*/
|
||||
public function actionCreate($root = null, $mapFile = null)
|
||||
{
|
||||
if ($root === null) {
|
||||
$root = YII_PATH;
|
||||
$root = YII2_PATH;
|
||||
}
|
||||
$root = FileHelper::normalizePath($root);
|
||||
if ($mapFile === null) {
|
||||
$mapFile = YII_PATH . '/classes.php';
|
||||
$mapFile = YII2_PATH . '/classes.php';
|
||||
}
|
||||
$options = [
|
||||
'filter' => function ($path) {
|
||||
@ -60,7 +60,7 @@ class ClassmapController extends Controller
|
||||
throw new Exception("Something wrong: $file\n");
|
||||
}
|
||||
$path = str_replace('\\', '/', substr($file, strlen($root)));
|
||||
$map[$path] = " 'yii" . substr(str_replace('/', '\\', $path), 0, -4) . "' => YII_PATH . '$path',";
|
||||
$map[$path] = " 'yii" . substr(str_replace('/', '\\', $path), 0, -4) . "' => YII2_PATH . '$path',";
|
||||
}
|
||||
ksort($map);
|
||||
$map = implode("\n", $map);
|
||||
|
Reference in New Issue
Block a user