Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 258 forks source link

模板渲染问题 #6

Closed idoubi closed 7 years ago

idoubi commented 7 years ago

/lib/business/TXResponse.php中的这段代码读取缓冲区内容不稳定,导致前端页面渲染失败:

        ob_start();
        //include template
        $lang = TXLanguage::getLanguage();
        $file = sprintf('%s/template/%s%s.tpl.php', TXApp::$app_root, $this->view, $lang ?'.'.$lang : "");
        if (!is_readable($file)){
            $file = sprintf('%s/template/%s.tpl.php', TXApp::$app_root, $this->view);
        }
        if (!is_readable($file)){
            throw new TXException(2005, $this->view);
        }
        include $file;
        TXLogger::showLogs();

        $content = ob_get_clean();
        return $content;
1
billge1205 commented 7 years ago

看起来像是php.ini配置上的问题 框架运用在很多项目中并没有这种情况 你可以尝试打开opcache 可能会有作用

billge1205 commented 7 years ago

我知道了 php.ini里打开 short_open_tag就行了 因为biny里模版用的都是简写 wiki里有写的