Closed ouewqa closed 8 years ago
public function __construct($file) { if (strlen($file) < 255 && !is_file($file)) { $appRoot = getenv('XS_APP_ROOT'); if ($appRoot === false) { $appRoot = defined('XS_APP_ROOT') ? XS_APP_ROOT : XS_LIB_ROOT . '/../app'; } $file2 = $appRoot . '/' . $file . '.ini'; if (is_file($file2)) { $file = $file2; } else { throw new \Exception(sprintf('File [%s] is not exist!', $file)); } } $this->loadIniFile($file); self::$_lastXS = $this; }
我修改了类名,忘了修改配置名,结果查了好久才找到原因。这里判断配置不存在的情况,抛出异常。
我修改了类名,忘了修改配置名,结果查了好久才找到原因。这里判断配置不存在的情况,抛出异常。