diff --git a/framework/library/Config.php b/framework/library/Config.php index ddfa0b3..b7633b2 100644 --- a/framework/library/Config.php +++ b/framework/library/Config.php @@ -57,12 +57,14 @@ class Config if (!isset(self::$files[$file])) { if (file_exists($file)) { $config = require $file; - // 合并配置项 - foreach ($config as $key => $value) { - if (array_key_exists($key, $this->config)) { - $this->config[$key] = array_merge($this->config[$key], $config[$key]); - } else { - $this->config[$key] = $value; + if (is_array($config) && !empty($config)) { + // 合并配置项 + foreach ($config as $key => $value) { + if (array_key_exists($key, $this->config)) { + $this->config[$key] = array_merge($this->config[$key], $config[$key]); + } else { + $this->config[$key] = $value; + } } } self::$files[$file] = true; diff --git a/framework/library/Router.php b/framework/library/Router.php index a2d7185..603c7df 100644 --- a/framework/library/Router.php +++ b/framework/library/Router.php @@ -76,7 +76,7 @@ class Router } // 检查方法在控制器中是否存在 if (!in_array($this->method, get_class_methods($this->class))) { - throw new RouteException('方法' . $this->action . '在控制器' . $this->ctrl . '中不存在'); + throw new RouteException('方法' . $this->method . '在控制器' . $this->ctrl . '中不存在'); } }