public static function run($app, $controller = null, $action = null) { self::$app = $app; $autoload = AutoLoad::getInstance(); //加载配置文件 $config = DOCUMENT_ROOT . DS . 'app' . DS . $app . DS . 'config.php'; if (!is_file($config)) { throw new \Exception($app . '应用缺少config文件', 0); } else { require $config; self::$config = new \Config(); self::$config->loader($autoload); } //分发路由 $route = new Route($app); $route->execute($controller, $action); }