本文整理汇总了PHP中Profiler::disable方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::disable方法的具体用法?PHP Profiler::disable怎么用?PHP Profiler::disable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::disable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
}
// Set our prettify options.
if ($options['prettify']) {
\ProfilerRenderer::setIncludePrettify(true);
\ProfilerRenderer::setPrettifyLocation($options['prettify']);
} else {
\ProfilerRenderer::setIncludePrettify(false);
}
/**
* Due to the way the `Environment` class determines the current configuration
* we need to wait for the `Dispatcher` to start up before we know where we are.
*/
Filters::apply('lithium\\action\\Dispatcher', '_callable', function ($self, $params, $chain) {
if (!Environment::is(Libraries::get('li3_profiler', 'environment'))) {
// Enable the profiler.
\Profiler::disable();
} else {
$controller = $chain->next($self, $params, $chain);
if (Libraries::get('li3_profiler', 'inject')) {
/**
* If we have a `Controller` object we will filter it so that we can
* inject our rendering HTML.
*/
if (is_a($controller, '\\lithium\\action\\Controller')) {
$controller->applyFilter('__invoke', function ($self, $params, $chain) {
$response = $chain->next($self, $params, $chain);
if ($response->type === 'text/html') {
/**
* Here we tack in our rendering if the `Response` object happens
* to be "text/html" and we are enabled.
*/
示例2: postDump
/**
* show post debug
*
* @param string $key
* @return Response
*/
protected function postDump($key)
{
Profiler::disable();
$post = Post::find($key);
ob_start();
var_dump($post);
$dump = ob_get_clean();
$response = Response::make($dump);
$response->header('charset', 'utf-8');
return $response;
}