Writes DB events as log messages to the Firebug Console via FirePHP.

category Zend
package Zend_Db
subpackage Profiler
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Db_Profiler

 Methods

Constructor

__construct(string $label = null) : void
inherited_from \Zend_Db_Profiler::__construct()

Parameters

$label

string

OPTIONAL Label for the profiling info.

Class constructor. The profiler is disabled by default unless it is specifically enabled by passing in $enabled here or calling setEnabled().

__construct(boolean $enabled = false) : void
Inherited

Parameters

$enabled

boolean

Clears the history of any past query profiles. This is relentless and will even clear queries that were started and may not have been marked as ended.

clear() : \Zend_Db_Profiler
Inherited

Returns

\Zend_Db_ProfilerProvides a fluent interface

Get the current state of enable. If True is returned, the profiler is enabled.

getEnabled() : boolean
Inherited

Returns

boolean

Returns the minimum number of seconds for saving query profiles, or null if query profiles are saved regardless of elapsed time.

getFilterElapsedSecs() : integer | null
Inherited

Returns

integernull

Returns the types of query profiles saved, or null if queries are saved regardless of their types.

getFilterQueryType() : integer | null
Inherited
see

Returns

integernull

Get the Zend_Db_Profiler_Query object for the last query that was run, regardless if it has ended or not. If the query has not ended, its end time will be null. If no queries have been profiled, false is returned.

getLastQueryProfile() : \Zend_Db_Profiler_Query | false
Inherited

Returns

\Zend_Db_Profiler_Queryfalse

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.

getQueryProfile(integer $queryId) : \Zend_Db_Profiler_Query
Inherited

Parameters

$queryId

integer

Exceptions

\Zend_Db_Profiler_Exception

Returns

\Zend_Db_Profiler_Query

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.

getQueryProfiles(integer $queryType = null, boolean $showUnfinished = false) : array | false
Inherited

Parameters

$queryType

integer

$showUnfinished

boolean

Returns

arrayfalse

Get the total elapsed time (in seconds) of all of the profiled queries.

getTotalElapsedSecs(integer $queryType = null) : float
Inherited

Only queries that have ended will be counted. If $queryType is set to one or more of the Zend_Db_Profiler::* constants, the elapsed time will be calculated only for queries of the given type(s).

Parameters

$queryType

integer

OPTIONAL

Returns

float

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.

getTotalNumQueries(integer $queryType = null) : integer
Inherited

Parameters

$queryType

integer

OPTIONAL

Returns

integer

Clone a profiler query

queryClone(\Zend_Db_Profiler_Query $query) : integer
Inherited

Parameters

$query

\Zend_Db_Profiler_Query

Returns

integeror null

Intercept the query end and log the profiling data.

queryEnd(integer $queryId) : void

This will mark the query as ended and save the time.

inherited_from \Zend_Db_Profiler::queryEnd()

Parameters

$queryId

integer

Exceptions

\Zend_Db_Profiler_Exception

Ends a query. Pass it the handle that was returned by queryStart().

queryEnd(integer $queryId) : string
Inherited

This will mark the query as ended and save the time.

Parameters

$queryId

integer

Exceptions

\Zend_Db_Profiler_Exception

Returns

stringInform that a query is stored or ignored.

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.

queryStart(string $queryText, integer $queryType = null) : integer | null
Inherited

Parameters

$queryText

string

SQL statement

$queryType

integer

OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants

Returns

integernull

Enable or disable the profiler. If $enable is false, the profiler is disabled and will not log any queries sent to it.

setEnabled(boolean $enable) : \Zend_Db_Profiler
inherited_from \Zend_Db_Profiler::setEnabled()

Parameters

$enable

boolean

Returns

\Zend_Db_ProfilerProvides a fluent interface

Enable or disable the profiler. If $enable is false, the profiler is disabled and will not log any queries sent to it.

setEnabled(boolean $enable) : \Zend_Db_Profiler
Inherited

Parameters

$enable

boolean

Returns

\Zend_Db_ProfilerProvides a fluent interface

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.

setFilterElapsedSecs(integer $minimumSeconds = null) : \Zend_Db_Profiler
Inherited

Parameters

$minimumSeconds

integer

OPTIONAL

Returns

\Zend_Db_ProfilerProvides a fluent interface

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.

setFilterQueryType(integer $queryTypes = null) : \Zend_Db_Profiler
Inherited

Parameters

$queryTypes

integer

OPTIONAL

Returns

\Zend_Db_ProfilerProvides a fluent interface

Update the label of the message holding the profile info.

updateMessageLabel() : void

 Properties

 

Stores enabled state of the profiler. If set to False, calls to queryStart() will simply be ignored.

$_enabled : boolean

Default

false
 

Stores the number of seconds to filter. NULL if filtering by time is disabled. If an integer is stored here, profiles whose elapsed time is less than this value in seconds will be unset from the self::$_queryProfiles array.

$_filterElapsedSecs : integer

Default

null
 

Logical OR of any of the filter constants. NULL if filtering by query type is disable. If an integer is stored here, it is the logical OR of any of the query type constants. When the query ends, if it is not one of the types specified, it will be unset from the self::$_queryProfiles array.

$_filterTypes : integer

Default

null
 

The original label for this profiler.

$_label : string

Default

null
 

The label template for this profiler

$_label_template : string

Default

'%label% (%totalCount% @ %totalDuration% sec)'
 

The message envelope holding the profiling summary

$_message : \Zend_Wildfire_Plugin_FirePhp_TableMessage

Default

null
 

Array of Zend_Db_Profiler_Query objects.

$_queryProfiles : array

Default

array()
 

The total time taken for all profiled queries.

$_totalElapsedTime : float

Default

0

 Constants

 

A connection operation or selecting a database.

CONNECT = 1 
 

An operation related to deleting data in the database, such as SQL's DELETE.

DELETE = 16 
 

Inform that a query is ignored (in case of filtering)

IGNORED = 'ignored' 
 

Adding new data to the database, such as SQL's INSERT.

INSERT = 4 
 

Any general database query that does not fit into the other constants.

QUERY = 2 
 

Retrieving information from the database, such as SQL's SELECT.

SELECT = 32 
 

Inform that a query is stored (in case of filtering)

STORED = 'stored' 
 

Transactional operation, such as start transaction, commit, or rollback.

TRANSACTION = 64 
 

Updating existing information in the database, such as SQL's UPDATE.

UPDATE = 8