本文整理汇总了PHP中Profiler::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::output方法的具体用法?PHP Profiler::output怎么用?PHP Profiler::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: finish
/**
* Cleans up Fuel execution, ends the output buffering, and outputs the
* buffer contents.
*
* @access public
* @return void
*/
public static function finish()
{
if (static::$caching && static::$paths_changed === true) {
static::cache('Fuel::path_cache', static::$path_cache);
}
// Grab the output buffer
$output = ob_get_clean();
if (static::$profiling) {
\Profiler::mark('End of Fuel Execution');
if (preg_match("|</body>.*?</html>|is", $output)) {
$output = preg_replace("|</body>.*?</html>|is", '', $output);
$output .= \Profiler::output();
$output .= '</body></html>';
} else {
$output .= \Profiler::output();
}
}
$bm = \Profiler::app_total();
// TODO: There is probably a better way of doing this, but this works for now.
$output = \str_replace(array('{exec_time}', '{mem_usage}'), array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)), $output);
// Send the buffer to the browser.
echo $output;
}
示例2: finish
/**
* Cleans up Fuel execution, ends the output buffering, and outputs the
* buffer contents.
*
* @access public
* @return void
*/
public static function finish()
{
if (\Config::get('caching', false)) {
\Finder::instance()->write_cache('FuelFileFinder');
}
if (static::$profiling and !static::$is_cli and !\Input::is_ajax()) {
// Grab the output buffer and flush it, we will rebuffer later
$output = ob_get_clean();
$headers = headers_list();
$show = true;
foreach ($headers as $header) {
if (stripos($header, 'content-type') === 0 and stripos($header, 'text/html') === false) {
$show = false;
}
}
if ($show) {
\Profiler::mark('End of Fuel Execution');
if (preg_match("|</body>.*?</html>|is", $output)) {
$output = preg_replace("|</body>.*?</html>|is", '', $output);
$output .= \Profiler::output();
$output .= '</body></html>';
} else {
$output .= \Profiler::output();
}
}
// Restart the output buffer and send the new output
ob_start();
echo $output;
}
}
示例3: finish
/**
* Cleans up Fuel execution, ends the output buffering, and outputs the
* buffer contents.
*
* @access public
* @return void
*/
public static function finish()
{
if (static::$caching and static::$paths_changed === true) {
static::cache('Fuel::path_cache', static::$path_cache);
}
if (static::$profiling) {
// Grab the output buffer and flush it, we will rebuffer later
$output = ob_get_clean();
\Profiler::mark('End of Fuel Execution');
if (preg_match("|</body>.*?</html>|is", $output)) {
$output = preg_replace("|</body>.*?</html>|is", '', $output);
$output .= \Profiler::output();
$output .= '</body></html>';
} else {
$output .= \Profiler::output();
}
// Restart the output buffer and send the new output
ob_start();
echo $output;
}
}