类库别名和调用修正

增加sae日志驱动
改进Hook类的exec方法
行为扩展优先检测标签方法 不存在则调用run方法
NOW_TIME改用REQUEST_TIME_FLOAT
变量命名规范
This commit is contained in:
thinkphp
2015-02-24 10:45:34 +08:00
parent 20bd23c7d1
commit d28e27270c
16 changed files with 148 additions and 102 deletions

View File

@@ -10,14 +10,10 @@
// +----------------------------------------------------------------------
namespace think\behavior;
use think\config;
use think\Config;
/**
* 系统行为扩展:模板内容输出替换
* @category Think
* @package Think
* @subpackage Behavior
* @author liu21st <liu21st@gmail.com>
*/
class ContentReplace {

View File

@@ -13,17 +13,14 @@ namespace think\behavior;
/**
* 系统行为扩展:定位模板文件
* @category Think
* @package Think
* @subpackage Behavior
* @author liu21st <liu21st@gmail.com>
*/
class LocationTemplate {
// 行为扩展的执行入口必须是run
public function run(&$templateFile){
// 自动定位模板文件
if(!is_file($templateFile))
if(!is_file($templateFile)){
$templateFile = $this->parseTemplateFile($templateFile);
}
}
/**
@@ -42,7 +39,7 @@ class LocationTemplate {
}elseif(false === strpos($template,'.')) {
$template = $template;
}
$templateFile = MODULE_PATH.'View/'.$template.'.html';
$templateFile = MODULE_PATH.'view/'.$template.'.html';
return $templateFile;
}
}

View File

@@ -42,7 +42,7 @@ class ShowPageTrace {
$info[] = $file.' ( '.number_format(filesize($file)/1024,2).' KB )';
}
$trace = [];
Debug::remark('START',$GLOBALS['startTime']);
Debug::remark('START',NOW_TIME);
$base = [
'请求信息' => date('Y-m-d H:i:s',$_SERVER['REQUEST_TIME']).' '.$_SERVER['SERVER_PROTOCOL'].' '.$_SERVER['REQUEST_METHOD'].' : '.$_SERVER['PHP_SELF'],
'运行时间' => Debug::getUseTime('START','END',6).'s',
@@ -84,7 +84,7 @@ class ShowPageTrace {
unset($files,$info,$base,$debug);
// 调用Trace页面模板
ob_start();
include Config::has('tmpl_trace_file')?Config::get('tmpl_trace_file'):THINK_PATH.'tpl/page_trace.tpl';
include Config::has('tmpl_trace_file') ? Config::get('tmpl_trace_file') : THINK_PATH.'tpl/page_trace.tpl';
return ob_get_clean();
}
}