Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
    • REST
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Db
      • Adapter
      • Expr
      • Profiler
      • Select
      • Statement
      • Table
    • Loader
      • Autoloader
      • PluginLoader
    • Registry

Classes

  • Zend_Db_Profiler
  • Zend_Db_Profiler_Firebug
  • Zend_Db_Profiler_Query

Exceptions

  • Zend_Db_Profiler_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Zend_Db_Profiler

Direct known subclasses

Zend_Db_Profiler_Firebug
Package: Zend\Db\Profiler
Category: Zend
Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: New BSD License
Located at Zend/Db/Profiler.php
Methods summary
public
# __construct( boolean $enabled = false )

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

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

Parameters

$enabled
boolean
public Zend_Db_Profiler
# setEnabled( boolean $enable )

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

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

Parameters

$enable
boolean

Returns

Zend_Db_Profiler
Provides a fluent interface
public boolean
# getEnabled( )

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

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

Returns

boolean
public Zend_Db_Profiler
# setFilterElapsedSecs( integer $minimumSeconds = null )

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.

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.

Parameters

$minimumSeconds
integer
OPTIONAL

Returns

Zend_Db_Profiler
Provides a fluent interface
public integer|null
# getFilterElapsedSecs( )

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

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

Returns

integer|null
public Zend_Db_Profiler
# setFilterQueryType( integer $queryTypes = null )

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.

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.

Parameters

$queryTypes
integer
OPTIONAL

Returns

Zend_Db_Profiler
Provides a fluent interface
public integer|null
# getFilterQueryType( )

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

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

Returns

integer|null

See

Zend_Db_Profiler::setFilterQueryType()
public Zend_Db_Profiler
# clear( )

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.

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.

Returns

Zend_Db_Profiler
Provides a fluent interface
public integer
# queryClone( Zend_Db_Profiler_Query $query )

Parameters

$query
integer
$queryId

Returns

integer
or null
public integer|null
# queryStart( string $queryText, integer $queryType = 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.

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.

Parameters

$queryText
string
SQL statement
$queryType
integer
OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants

Returns

integer|null
public
# queryEnd( integer $queryId )

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

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

Parameters

$queryId
integer

Throws

Zend_Db_Profiler_Exception
public Zend_Db_Profiler_Query
# getQueryProfile( integer $queryId )

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.

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.

Parameters

$queryId
integer

Returns

Zend_Db_Profiler_Query

Throws

Zend_Db_Profiler_Exception
public array|false
# getQueryProfiles( integer $queryType = null, boolean $showUnfinished = 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.

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.

Parameters

$queryType
integer
$showUnfinished
boolean

Returns

array|false
public float
# getTotalElapsedSecs( integer $queryType = null )

Get the total elapsed time (in seconds) of all of the profiled queries. 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).

Get the total elapsed time (in seconds) of all of the profiled queries. 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
public integer
# getTotalNumQueries( integer $queryType = null )

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.

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.

Parameters

$queryType
integer
OPTIONAL

Returns

integer
public Zend_Db_Profiler_Query|false
# getLastQueryProfile( )

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.

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.

Returns

Zend_Db_Profiler_Query|false
Constants summary
integer CONNECT 1
#

A connection operation or selecting a database.

A connection operation or selecting a database.

integer QUERY 2
#

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

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

integer INSERT 4
#

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

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

integer UPDATE 8
#

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

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

integer DELETE 16
#

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

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

integer SELECT 32
#

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

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

integer TRANSACTION 64
#

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

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

string STORED 'stored'
#

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

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

string IGNORED 'ignored'
#

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

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

Properties summary
protected array $_queryProfiles array()
#

Array of Zend_Db_Profiler_Query objects.

Array of Zend_Db_Profiler_Query objects.

protected boolean $_enabled false
#

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

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

protected integer $_filterElapsedSecs null
#

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.

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.

protected integer $_filterTypes 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.

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.

Pry Framework API documentation generated by ApiGen 2.6.1