/** * 系统关闭,并输出渲染内容 * * @return string */ public static function shutdown() { zotop::mark('zotop.shutdown'); //获取页面内容 $contents = ob_get_contents(); //清理输出数据 ob_end_clean(); //渲染页面内容 $contents = zotop::filter('system.render', $contents); //输入页面内容 echo $contents; }
/** * 渲染输出内容 * * @param string $output 待渲染输出的内容 * @return string */ public static function render($output) { $mark = zotop::mark('system.begin', 'system.end'); $output = str_replace(array('{$runtime}', '{$memory}', '{$include}'), array($mark['time'] . ' S', $mark['memory'] . ' MB', count(get_included_files())), $output); return $output; }