Db/Profiler/Firebug.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_Db
- subpackage
- Profiler
- version
- $Id: Firebug.php 23775 2011-03-01 17:25:24Z ralph $
\Zend_Db_Profiler_Firebug
Writes DB events as log messages to the Firebug Console via FirePHP.
- Extends from
- \Zend_Db_Profiler
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_Db
- subpackage
- Profiler
Properties



string
$_label= 'null'
The original label for this profiler.
Default valuenull
Details
- Type
- string



string
$_label_template= '%label% (%totalCount% @ %totalDuration% sec)'
The label template for this profiler
Default value%label% (%totalCount% @ %totalDuration% sec)
Details
- Type
- string



float
$_totalElapsedTime= '0'
The total time taken for all profiled queries.
Default value0
Details
- Type
- float
Methods



getQueryProfile(
integer $queryId
)
:
\Zend_Db_Profiler_Query
Get a profile for a query. Pass it the same handle that was returned
by queryStart() and it will return a Zend_Db_Profiler_Query object.
Inherited from:
\Zend_Db_Profiler::getQueryProfile()
Parameters
Name |
Type |
Description |
$queryId |
integer |
|
Returns
Throws



getQueryProfiles(
integer $queryType
=
null, boolean $showUnfinished
=
false
)
:
array|false
Get an array of query profiles (Zend_Db_Profiler_Query objects). If $queryType
is set to one of the Zend_Db_Profiler::* constants then only queries of that
type will be returned. Normally, queries that have not yet ended will
not be returned unless $showUnfinished is set to True. If no
queries were found, False is returned. The returned array is indexed by the query
profile handles.
Inherited from:
\Zend_Db_Profiler::getQueryProfiles()
Parameters
Name |
Type |
Description |
$queryType |
integer |
|
$showUnfinished |
boolean |
|
Returns
Type |
Description |
arrayfalse |
|



getTotalNumQueries(
integer $queryType
=
null
)
:
integer
Get the total number of queries that have been profiled. Only queries that have ended will
be counted. If $queryType is set to one of the Zend_Db_Profiler::* constants, only queries of
that type will be counted.
Inherited from:
\Zend_Db_Profiler::getTotalNumQueries()
Parameters
Name |
Type |
Description |
$queryType |
integer |
OPTIONAL |
Returns



queryEnd(
integer $queryId
)
:
void
Intercept the query end and log the profiling data.
This will mark the query as ended and save the time.
Parameters
Name |
Type |
Description |
$queryId |
integer |
|
Throws



queryStart(
string $queryText, integer $queryType
=
null
)
:
integer|null
Starts a query. Creates a new query profile object (Zend_Db_Profiler_Query)
and returns the "query profiler handle". Run the query, then call
queryEnd() and pass it this handle to make the query as ended and
record the time. If the profiler is not enabled, this takes no
action and immediately returns null.
Inherited from:
\Zend_Db_Profiler::queryStart()
Parameters
Name |
Type |
Description |
$queryText |
string |
SQL statement |
$queryType |
integer |
OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants
|
Returns
Type |
Description |
integernull |
|



setEnabled(
boolean $enable
)
:
\Zend_Db_Profiler
Enable or disable the profiler. If $enable is false, the profiler
is disabled and will not log any queries sent to it.
Parameters
Name |
Type |
Description |
$enable |
boolean |
|
Returns



setFilterElapsedSecs(
integer $minimumSeconds
=
null
)
:
\Zend_Db_Profiler
Sets a minimum number of seconds for saving query profiles. If this
is set, only those queries whose elapsed time is equal or greater than
$minimumSeconds will be saved. To save all queries regardless of
elapsed time, set $minimumSeconds to null.
Inherited from:
\Zend_Db_Profiler::setFilterElapsedSecs()
Parameters
Name |
Type |
Description |
$minimumSeconds |
integer |
OPTIONAL |
Returns



setFilterQueryType(
integer $queryTypes
=
null
)
:
\Zend_Db_Profiler
Sets the types of query profiles to save. Set $queryType to one of
the Zend_Db_Profiler::* constants to only save profiles for that type of
query. To save more than one type, logical OR them together. To
save all queries regardless of type, set $queryType to null.
Inherited from:
\Zend_Db_Profiler::setFilterQueryType()
Parameters
Name |
Type |
Description |
$queryTypes |
integer |
OPTIONAL |
Returns