Db/Profiler/Firebug.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Db  
Subpackage
Profiler  
Version
$Id: Firebug.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Db_Profiler_Firebug

Package: Zend\Db\Profiler

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

Parent(s)
\Zend_Db_Profiler
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  CONNECT = 1
inherited

A connection operation or selecting a database.

Inherited from: \Zend_Db_Profiler::CONNECT
Inherited_from
\Zend_Db_Profiler::CONNECT  
Constant  QUERY = 2
inherited

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

Inherited from: \Zend_Db_Profiler::QUERY
Inherited_from
\Zend_Db_Profiler::QUERY  
Constant  INSERT = 4
inherited

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

Inherited from: \Zend_Db_Profiler::INSERT
Inherited_from
\Zend_Db_Profiler::INSERT  
Constant  UPDATE = 8
inherited

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

Inherited from: \Zend_Db_Profiler::UPDATE
Inherited_from
\Zend_Db_Profiler::UPDATE  
Constant  DELETE = 16
inherited

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

Inherited from: \Zend_Db_Profiler::DELETE
Inherited_from
\Zend_Db_Profiler::DELETE  
Constant  SELECT = 32
inherited

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

Inherited from: \Zend_Db_Profiler::SELECT
Inherited_from
\Zend_Db_Profiler::SELECT  
Constant  TRANSACTION = 64
inherited

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

Inherited from: \Zend_Db_Profiler::TRANSACTION
Inherited_from
\Zend_Db_Profiler::TRANSACTION  
Constant  STORED = 'stored'
inherited

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

Inherited from: \Zend_Db_Profiler::STORED
Inherited_from
\Zend_Db_Profiler::STORED  
Constant  IGNORED = 'ignored'
inherited

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

Inherited from: \Zend_Db_Profiler::IGNORED
Inherited_from
\Zend_Db_Profiler::IGNORED  

Properties

Propertyprotectedboolean $_enabled = false
inherited

Stores enabled state of the profiler.

Inherited from: \Zend_Db_Profiler::$$_enabled

If set to False, calls to queryStart() will simply be ignored.

Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Db_Profiler::$$_enabled  
Propertyprotectedinteger $_filterElapsedSecs = null
inherited

Stores the number of seconds to filter.

Inherited from: \Zend_Db_Profiler::$$_filterElapsedSecs

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.

Default valuenullDetails
Type
integer
Inherited_from
\Zend_Db_Profiler::$$_filterElapsedSecs  
Propertyprotectedinteger $_filterTypes = null
inherited

Logical OR of any of the filter constants.

Inherited from: \Zend_Db_Profiler::$$_filterTypes

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.

Default valuenullDetails
Type
integer
Inherited_from
\Zend_Db_Profiler::$$_filterTypes  
Propertyprotectedstring $_label = null

The original label for this profiler.

Default valuenullDetails
Type
string
Propertyprotectedstring $_label_template = '%label% (%totalCount% @ %totalDuration% sec)'

The label template for this profiler

Default value'%label% (%totalCount% @ %totalDuration% sec)'Details
Type
string
Propertyprotected\Zend_Wildfire_Plugin_FirePhp_TableMessage $_message = null

The message envelope holding the profiling summary

Default valuenullDetails
Type
\Zend_Wildfire_Plugin_FirePhp_TableMessage
Propertyprotectedarray $_queryProfiles = array()
inherited

Array of Zend_Db_Profiler_Query objects.

Inherited from: \Zend_Db_Profiler::$$_queryProfiles
Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Profiler::$$_queryProfiles  
Propertyprotectedfloat $_totalElapsedTime = 0

The total time taken for all profiled queries.

Default value0Details
Type
float

Methods

methodpublic__construct(string $label = null) : void

Constructor

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

Parameters
Name Type Description
$label string

OPTIONAL Label for the profiling info.

methodpublicclear() : \Zend_Db_Profiler
inherited

Clears the history of any past query profiles.

Inherited from: \Zend_Db_Profiler::clear()

This is relentless and will even clear queries that were started and may not have been marked as ended.

Returns
Type Description
\Zend_Db_Profiler Provides a fluent interface
methodpublicgetEnabled() : boolean
inherited

Get the current state of enable.

Inherited from: \Zend_Db_Profiler::getEnabled()

If True is returned, the profiler is enabled.

Returns
Type Description
boolean
methodpublicgetFilterElapsedSecs() : integer | null
inherited

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

Inherited from: \Zend_Db_Profiler::getFilterElapsedSecs()
Returns
Type Description
integer | null
methodpublicgetFilterQueryType() : integer | null
inherited

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

Inherited from: \Zend_Db_Profiler::getFilterQueryType()
Returns
Type Description
integer | null
Details
See
\global\Zend_Db_Profiler::setFilterQueryType()  
methodpublicgetLastQueryProfile() : \Zend_Db_Profiler_Query | false
inherited

Get the Zend_Db_Profiler_Query object for the last query that was run, regardless if it has ended or not.

Inherited from: \Zend_Db_Profiler::getLastQueryProfile()

If the query has not ended, its end time will be null. If no queries have been profiled, false is returned.

Returns
Type Description
\Zend_Db_Profiler_Query | false
methodpublicgetQueryProfile(integer $queryId) : \Zend_Db_Profiler_Query
inherited

Get a profile for a query.

Inherited from: \Zend_Db_Profiler::getQueryProfile()

Pass it the same handle that was returned by queryStart() and it will return a Zend_Db_Profiler_Query object.

Parameters
Name Type Description
$queryId integer
Returns
Type Description
\Zend_Db_Profiler_Query
Throws
Exception Description
\Zend_Db_Profiler_Exception
methodpublicgetQueryProfiles(integer $queryType = null, boolean $showUnfinished = false) : array | false
inherited

Get an array of query profiles (Zend_Db_Profiler_Query objects).

Inherited from: \Zend_Db_Profiler::getQueryProfiles()

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.

Parameters
Name Type Description
$queryType integer
$showUnfinished boolean
Returns
Type Description
array | false
methodpublicgetTotalElapsedSecs(integer $queryType = null) : float
inherited

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

Inherited from: \Zend_Db_Profiler::getTotalElapsedSecs()

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
Name Type Description
$queryType integer

OPTIONAL

Returns
Type Description
float
methodpublicgetTotalNumQueries(integer $queryType = null) : integer
inherited

Get the total number of queries that have been profiled.

Inherited from: \Zend_Db_Profiler::getTotalNumQueries()

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.

Parameters
Name Type Description
$queryType integer

OPTIONAL

Returns
Type Description
integer
methodpublicqueryClone(\Zend_Db_Profiler_Query $query) : integer
inherited

Clone a profiler query

Inherited from: \Zend_Db_Profiler::queryClone()
Parameters
Name Type Description
$query \Zend_Db_Profiler_Query
Returns
Type Description
integer or null
methodpublicqueryEnd(integer $queryId) : void

Intercept the query end and log the profiling data.

Pass it the handle that was returned by queryStart(). This will mark the query as ended and save the time.

Parameters
Name Type Description
$queryId integer
Throws
Exception Description
\Zend_Db_Profiler_Exception
methodpublicqueryStart(string $queryText, integer $queryType = null) : integer | null
inherited

Starts a query.

Inherited from: \Zend_Db_Profiler::queryStart()

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.

Parameters
Name Type Description
$queryText string

SQL statement

$queryType integer

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

Returns
Type Description
integer | null
methodpublicsetEnabled(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
Type Description
\Zend_Db_Profiler Provides a fluent interface
methodpublicsetFilterElapsedSecs(integer $minimumSeconds = null) : \Zend_Db_Profiler
inherited

Sets a minimum number of seconds for saving query profiles.

Inherited from: \Zend_Db_Profiler::setFilterElapsedSecs()

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.

Parameters
Name Type Description
$minimumSeconds integer

OPTIONAL

Returns
Type Description
\Zend_Db_Profiler Provides a fluent interface
methodpublicsetFilterQueryType(integer $queryTypes = null) : \Zend_Db_Profiler
inherited

Sets the types of query profiles to save.

Inherited from: \Zend_Db_Profiler::setFilterQueryType()

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.

Parameters
Name Type Description
$queryTypes integer

OPTIONAL

Returns
Type Description
\Zend_Db_Profiler Provides a fluent interface
methodprotectedupdateMessageLabel() : void

Update the label of the message holding the profile info.

Documentation was generated by phpDocumentor 2.0.0a8.