本文整理汇总了PHP中Profiler::end方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::end方法的具体用法?PHP Profiler::end怎么用?PHP Profiler::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
// Define used classes.
use lithium\util\collection\Filters;
use lithium\data\Connections;
// Attach to the `Connections` adapters after dispatch.
Filters::apply('\\lithium\\action\\Dispatcher', '_callable', function ($self, $params, $chain) {
/**
* Loop over all defined `Connections` adapters and tack in our
* filter on the `_execute` method.
*/
foreach (Connections::get() as $connection) {
$connection = Connections::get($connection);
$connection->applyFilter('_execute', function ($self, $params, $chain) {
$profiler = \Profiler::sqlStart($params['sql']);
$response = $chain->next($self, $params, $chain);
$profiler->end();
return $response;
});
$connection->applyFilter('read', function ($self, $params, $chain) {
$response = $chain->next($self, $params, $chain);
\Profiler::start($response->model());
$info = $response->result()->resource();
$profiler = \Profiler::sqlStart(json_encode($info->info()));
$profiler->end();
\Profiler::end($response->model());
return $response;
});
}
// Return the controller.
return $chain->next($self, $params, $chain);
});
示例2: end
public static function end($nodeName, $nuke = false)
{
return Profiler::end($nodeName, $nuke);
}