当前位置: 首页>>代码示例>>PHP>>正文


PHP Profiler::sqlStart方法代码示例

本文整理汇总了PHP中Profiler::sqlStart方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::sqlStart方法的具体用法?PHP Profiler::sqlStart怎么用?PHP Profiler::sqlStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


在下文中一共展示了Profiler::sqlStart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: usleep

ProfilerRenderer::setIncludeJquery(true);
ProfilerRenderer::setJqueryLocation('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');
ProfilerRenderer::setPrettifyLocation("../code-prettify");
$s1 = Profiler::start('Step 1');
//do some important things!
usleep(500000);
// 0.5 sec
$s1->end();
$s2 = Profiler::start('Step 2');
//more important things
usleep(100000);
// 0.1 sec
$s3 = Profiler::start('Step 3');
//some nested things..that are important and stuff.
sleep(1);
$sql = Profiler::sqlStart("SELECT * FROM TABLE WHERE 1");
usleep(1500000);
// 1.5 sec
$sql->end();
$s3->end();
$s2->end();
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>php-profiler demo</title>
</head>
<body>
	
<?php 
Profiler::render();
开发者ID:roadrunner,项目名称:php-profiler,代码行数:31,代码来源:demo.php

示例2: 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);
});
开发者ID:joebeeson,项目名称:li3_profiler,代码行数:30,代码来源:Model.php

示例3: sqlStart

 public static function sqlStart($query)
 {
     return Profiler::sqlStart($query);
 }
开发者ID:WickyLeo,项目名称:bobcat,代码行数:4,代码来源:ProfilerAgent.class.php


注:本文中的Profiler::sqlStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。