From fad58a308228740cab7f6300e01304bea0bc8b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E6=97=A0=E5=BF=83?= <448901948@qq.com> Date: Thu, 25 Feb 2016 17:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3console=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mode/console.php | 19 ++++++++++++++++--- mode/console/Error.php | 25 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 mode/console/Error.php diff --git a/mode/console.php b/mode/console.php index 194893b9..fcb3cb0d 100644 --- a/mode/console.php +++ b/mode/console.php @@ -21,9 +21,22 @@ return [ 'traits' => LIB_PATH . 'traits' . DS, APP_NAMESPACE => APP_PATH, ], - - 'config' => [ - 'commands' => [], + // 别名定义 + 'alias' => [ + 'think\Error' => MODE_PATH . 'console/Error' . EXT, ], + // 配置文件 + 'config' => [ + 'log' => [ + 'type' => 'File', // 支持 file socket trace sae + 'path' => LOG_PATH, + ], + 'cache' => [ + 'type' => 'File', + 'path' => CACHE_PATH, + 'prefix' => '', + 'expire' => 0, + ] + ] ]; diff --git a/mode/console/Error.php b/mode/console/Error.php new file mode 100644 index 00000000..6f84280c --- /dev/null +++ b/mode/console/Error.php @@ -0,0 +1,25 @@ + +// +---------------------------------------------------------------------- +namespace think; + +class Error +{ + /** + * 注册异常处理 + * @return void + */ + public static function register() + { + ini_set("display_errors","Off"); + //TODO + } + +} \ No newline at end of file