App类的run方法参数为可选

This commit is contained in:
thinkphp
2016-05-24 12:40:21 +08:00
parent 165c72e0aa
commit 6e11fbc025
2 changed files with 5 additions and 3 deletions

View File

@@ -32,12 +32,14 @@ class App
/** /**
* 执行应用程序 * 执行应用程序
* @access public * @access public
* @param \think\Request $request Request对象 * @param null|\think\Request $request Request对象
* @return mixed * @return mixed
* @throws Exception * @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()); $config = self::initModule(COMMON_MODULE, Config::get());

View File

@@ -64,5 +64,5 @@ if (APP_HOOK && isset($mode['tags'])) {
// 是否自动运行 // 是否自动运行
if (APP_AUTO_RUN) { if (APP_AUTO_RUN) {
App::run(Request::instance()); App::run();
} }