From 6e11fbc02564f9d3b1a935f1eaffb7f29cab0bd3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 24 May 2016 12:40:21 +0800 Subject: [PATCH] =?UTF-8?q?App=E7=B1=BB=E7=9A=84run=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=BA=E5=8F=AF=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 6 ++++-- start.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/library/think/App.php b/library/think/App.php index 6a5b669f..6120a7b0 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -32,12 +32,14 @@ class App /** * 执行应用程序 * @access public - * @param \think\Request $request Request对象 + * @param null|\think\Request $request Request对象 * @return mixed * @throws Exception */ - public static function run($request) + public static function run($request = null) { + is_null($request) && $request = Request::instance(); + // 初始化应用(公共模块) $config = self::initModule(COMMON_MODULE, Config::get()); diff --git a/start.php b/start.php index 9ad4264e..5ad6f069 100644 --- a/start.php +++ b/start.php @@ -64,5 +64,5 @@ if (APP_HOOK && isset($mode['tags'])) { // 是否自动运行 if (APP_AUTO_RUN) { - App::run(Request::instance()); + App::run(); }