SHOW_RUN_TIME不能正常工作及其解决办法

浏览:750 发布日期:2011/11/24
- 普通 - 未处理
[i=s] 本帖最后由 慕晓飞 于 2011-11-24 14:35 编辑 [/i]

ThinkPHP\Lib\Think\Core\View.class
protected function output($content,$display)方法中
if(C('HTML_CACHE_ON'))  HtmlCache::writeHTMLCache($content);
if($display) {
    if(false !== strpos($content,'{__RUNTIME__}'))
    {
        $runtime = C('SHOW_RUN_TIME')? ''.$this->showTime().'
' : '';
        $content = str_replace('{__RUNTIME__}', $runtime, $content);
    }
    echo $content;
    if(C('SHOW_PAGE_TRACE'))   $this->showTrace();
    return null;
}else {
    return $content;
}
改为if(C('HTML_CACHE_ON'))  HtmlCache::writeHTMLCache($content);
if($display) {
    $runtime = C('SHOW_RUN_TIME')? ''.$this->showTime().'
' : '';
    if(false !== strpos($content,'{__RUNTIME__}'))
    {
        $content = str_replace('{__RUNTIME__}', $runtime, $content);
    }
    else
        $content .= $runtime;
    echo $content;
    if(C('SHOW_PAGE_TRACE'))   $this->showTrace();
    return null;
}else {
    return $content;
}
评论(
后面还有条评论,点击查看>>