修正 几个Notice级的错误

This commit is contained in:
huangdijia
2015-01-19 16:27:14 +08:00
parent f9d8ce8c1e
commit 0035b77d56
4 changed files with 8 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ class App {
// 执行操作 // 执行操作
if(!preg_match('/^[A-Za-z](\/|\w)*$/',CONTROLLER_NAME)){ // 安全检测 if(!preg_match('/^[A-Za-z](\/|\w)*$/',CONTROLLER_NAME)){ // 安全检测
$instance = false; $instance = false;
}elseif($config['action_bind_class']){ }elseif(isset($config['action_bind_class']) && $config['action_bind_class']){
// 操作绑定到类:模块\Controller\控制器\操作 // 操作绑定到类:模块\Controller\控制器\操作
$layer = $config['controller_layer']; $layer = $config['controller_layer'];
if(is_dir(MODULE_PATH.$layer.'/'.CONTROLLER_NAME)){ 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); Route::checkDomain($config);
} }
@@ -260,7 +260,7 @@ class App {
static private function getModule($config){ static private function getModule($config){
$module = strtolower(isset($_GET[$config['var_module']]) ? $_GET[$config['var_module']] : $config['default_module']); $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])) { if(isset($maps[$module])) {
// 记录当前别名 // 记录当前别名
define('MODULE_ALIAS',$module); define('MODULE_ALIAS',$module);

View File

@@ -78,7 +78,7 @@ class Log {
* @param string $destination 写入目标 * @param string $destination 写入目标
* @return void * @return void
*/ */
static public function write($log,$level,$destination='') { static public function write($log,$level='',$destination='') {
self::$storage && self::$storage->write("{$level}: {$log}",$destination); self::$storage && self::$storage->write("{$level}: {$log}",$destination);
} }
} }

View File

@@ -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格式返回的处理方法 'default_jsonp_handler' => 'jsonpReturn', // 默认JSONP格式返回的处理方法
'var_jsonp_handler' => 'callback', 'var_jsonp_handler' => 'callback',
'template_engine' => 'think', 'template_engine' => 'think',
'common_module' => 'Common',
/* 错误设置 */ /* 错误设置 */
'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效 'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效

View File

@@ -37,6 +37,8 @@ return [
'var_jsonp_handler' => 'callback', 'var_jsonp_handler' => 'callback',
'template_engine' => 'think', 'template_engine' => 'think',
'common_module' => 'Common',
/* 错误设置 */ /* 错误设置 */
'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效 'error_message' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效
'error_page' => '', // 错误定向页面 'error_page' => '', // 错误定向页面