From 9ea738ee26cc14db5234205bc9c79317d444d27e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 2 Feb 2016 15:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 3 +++ library/think/Log.php | 6 ------ tests/thinkphp/library/think/inputTest.php | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/library/think/App.php b/library/think/App.php index 4c75f1f4..ad90d1c9 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -74,6 +74,9 @@ class App Session::init($config['session']); } + // 日志初始化 + Log::init($config['log']); + if (empty(self::$dispatch['type'])) { // 未指定调度类型 则进行URL路由检测 self::route($config); diff --git a/library/think/Log.php b/library/think/Log.php index aaecfbf2..6c62b871 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -80,9 +80,6 @@ class Log */ public static function save() { - if (is_null(self::$driver)) { - self::init(Config::get('log')); - } self::$driver->save(self::$log); } @@ -102,9 +99,6 @@ class Log // 监听log_write APP_HOOK && Hook::listen('log_write', $log); - if (is_null(self::$driver)) { - self::init(Config::get('log')); - } // 写入日志 self::$driver->save($log); } diff --git a/tests/thinkphp/library/think/inputTest.php b/tests/thinkphp/library/think/inputTest.php index ac533833..dedbe623 100644 --- a/tests/thinkphp/library/think/inputTest.php +++ b/tests/thinkphp/library/think/inputTest.php @@ -174,7 +174,7 @@ class inputTest extends \PHPUnit_Framework_TestCase //$path = $_SERVER['PATH_INFO'] ? explode('/', $_SERVER['PATH_INFO'])[0] : ''; //$this->assertEquals($path, Input::path('0', '')); - $_FILES = ['file' => ['name' => 'test.png', 'type' => 'image/png', 'tmp_name' => '/tmp/php5Wx0aJ', 'error' => 0, size => 15726]]; + $_FILES = ['file' => ['name' => 'test.png', 'type' => 'image/png', 'tmp_name' => '/tmp/php5Wx0aJ', 'error' => 0, 'size' => 15726]]; $this->assertEquals('image/png', Input::file('file.type')); }