mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
support loading config by alias.
This commit is contained in:
@ -98,8 +98,8 @@ class Application extends \yii\base\Application
|
|||||||
foreach ($_SERVER['argv'] as $param) {
|
foreach ($_SERVER['argv'] as $param) {
|
||||||
if (strpos($param, $option) !== false) {
|
if (strpos($param, $option) !== false) {
|
||||||
$path = substr($param, strlen($option));
|
$path = substr($param, strlen($option));
|
||||||
if (!empty($path) && is_file($path)) {
|
if (!empty($path) && is_file($file = Yii::getAlias($path))) {
|
||||||
return require($path);
|
return require($file);
|
||||||
} else {
|
} else {
|
||||||
die("The configuration file does not exist: $path\n");
|
die("The configuration file does not exist: $path\n");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user