From 0035b77d56945045547c7e5239017090b3a8224e Mon Sep 17 00:00:00 2001 From: huangdijia Date: Mon, 19 Jan 2015 16:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E5=87=A0=E4=B8=AANotice?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Think/App.php | 6 +++--- Library/Think/Log.php | 2 +- Mode/common.php | 3 ++- convention.php | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Library/Think/App.php b/Library/Think/App.php index c5e6fed8..6d594bce 100644 --- a/Library/Think/App.php +++ b/Library/Think/App.php @@ -59,7 +59,7 @@ class App { // 执行操作 if(!preg_match('/^[A-Za-z](\/|\w)*$/',CONTROLLER_NAME)){ // 安全检测 $instance = false; - }elseif($config['action_bind_class']){ + }elseif(isset($config['action_bind_class']) && $config['action_bind_class']){ // 操作绑定到类:模块\Controller\控制器\操作 $layer = $config['controller_layer']; if(is_dir(MODULE_PATH.$layer.'/'.CONTROLLER_NAME)){ @@ -165,7 +165,7 @@ class App { } // 检测域名部署 - if(!IS_CLI && $config['sub_domain_deploy']) { + if(!IS_CLI && isset($config['sub_domain_deploy']) && $config['sub_domain_deploy']) { Route::checkDomain($config); } @@ -260,7 +260,7 @@ class App { static private function getModule($config){ $module = strtolower(isset($_GET[$config['var_module']]) ? $_GET[$config['var_module']] : $config['default_module']); - if($maps = $config['url_module_map']) { + if(isset($config['url_module_map']) && $maps = $config['url_module_map']) { if(isset($maps[$module])) { // 记录当前别名 define('MODULE_ALIAS',$module); diff --git a/Library/Think/Log.php b/Library/Think/Log.php index 20498c1a..1b008e38 100644 --- a/Library/Think/Log.php +++ b/Library/Think/Log.php @@ -78,7 +78,7 @@ class Log { * @param string $destination 写入目标 * @return void */ - static public function write($log,$level,$destination='') { + static public function write($log,$level='',$destination='') { self::$storage && self::$storage->write("{$level}: {$log}",$destination); } } diff --git a/Mode/common.php b/Mode/common.php index 7357b9af..084dc88c 100644 --- a/Mode/common.php +++ b/Mode/common.php @@ -14,7 +14,7 @@ namespace Think; */ // 加载框架底层语言包 -Lang::set(include THINK_PATH.'Lang/'.strtolower(Config::get('default_lang')).EXT); +is_file(THINK_PATH.'Lang/'.strtolower(Config::get('default_lang')).EXT) && Lang::set(include THINK_PATH.'Lang/'.strtolower(Config::get('default_lang')).EXT); // 初始化操作可以在应用的公共文件中处理 下面只是示例 @@ -62,6 +62,7 @@ return [ 'default_jsonp_handler' => 'jsonpReturn', // 默认JSONP格式返回的处理方法 'var_jsonp_handler' => 'callback', 'template_engine' => 'think', + 'common_module' => 'Common', /* 错误设置 */ 'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效 diff --git a/convention.php b/convention.php index 52c8c9d3..640cc040 100644 --- a/convention.php +++ b/convention.php @@ -37,6 +37,8 @@ return [ 'var_jsonp_handler' => 'callback', 'template_engine' => 'think', + 'common_module' => 'Common', + /* 错误设置 */ 'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效 'error_page' => '', // 错误定向页面