修复项目空配置问题、路由错误提示
This commit is contained in:
parent
4e70ddd22d
commit
e752358bf6
|
@ -57,12 +57,14 @@ class Config
|
||||||
if (!isset(self::$files[$file])) {
|
if (!isset(self::$files[$file])) {
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$config = require $file;
|
$config = require $file;
|
||||||
// 合并配置项
|
if (is_array($config) && !empty($config)) {
|
||||||
foreach ($config as $key => $value) {
|
// 合并配置项
|
||||||
if (array_key_exists($key, $this->config)) {
|
foreach ($config as $key => $value) {
|
||||||
$this->config[$key] = array_merge($this->config[$key], $config[$key]);
|
if (array_key_exists($key, $this->config)) {
|
||||||
} else {
|
$this->config[$key] = array_merge($this->config[$key], $config[$key]);
|
||||||
$this->config[$key] = $value;
|
} else {
|
||||||
|
$this->config[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self::$files[$file] = true;
|
self::$files[$file] = true;
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Router
|
||||||
}
|
}
|
||||||
// 检查方法在控制器中是否存在
|
// 检查方法在控制器中是否存在
|
||||||
if (!in_array($this->method, get_class_methods($this->class))) {
|
if (!in_array($this->method, get_class_methods($this->class))) {
|
||||||
throw new RouteException('方法' . $this->action . '在控制器' . $this->ctrl . '中不存在');
|
throw new RouteException('方法' . $this->method . '在控制器' . $this->ctrl . '中不存在');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue