本文整理匯總了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;
}
}