diff options
Diffstat (limited to 'libs/Zend/Db/Profiler.php')
-rw-r--r-- | libs/Zend/Db/Profiler.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/libs/Zend/Db/Profiler.php b/libs/Zend/Db/Profiler.php index d0b2af5f1a..9d695b877d 100644 --- a/libs/Zend/Db/Profiler.php +++ b/libs/Zend/Db/Profiler.php @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Profiler.php 16203 2009-06-21 18:56:17Z thomas $ + * @version $Id: Profiler.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler @@ -68,6 +68,15 @@ class Zend_Db_Profiler */ const TRANSACTION = 64; + /** + * Inform that a query is stored (in case of filtering) + */ + const STORED = 'stored'; + + /** + * Inform that a query is ignored (in case of filtering) + */ + const IGNORED = 'ignored'; /** * Array of Zend_Db_Profiler_Query objects. @@ -269,7 +278,7 @@ class Zend_Db_Profiler /** * @see Zend_Db_Profiler_Query */ - require_once 'Zend/Db/Profiler/Query.php'; + // require_once 'Zend/Db/Profiler/Query.php'; $this->_queryProfiles[] = new Zend_Db_Profiler_Query($queryText, $queryType); end($this->_queryProfiles); @@ -289,7 +298,7 @@ class Zend_Db_Profiler { // Don't do anything if the Zend_Db_Profiler is not enabled. if (!$this->_enabled) { - return; + return self::IGNORED; } // Check for a valid query handle. @@ -297,7 +306,7 @@ class Zend_Db_Profiler /** * @see Zend_Db_Profiler_Exception */ - require_once 'Zend/Db/Profiler/Exception.php'; + // require_once 'Zend/Db/Profiler/Exception.php'; throw new Zend_Db_Profiler_Exception("Profiler has no query with handle '$queryId'."); } @@ -308,7 +317,7 @@ class Zend_Db_Profiler /** * @see Zend_Db_Profiler_Exception */ - require_once 'Zend/Db/Profiler/Exception.php'; + // require_once 'Zend/Db/Profiler/Exception.php'; throw new Zend_Db_Profiler_Exception("Query with profiler handle '$queryId' has already ended."); } @@ -321,7 +330,7 @@ class Zend_Db_Profiler */ if (null !== $this->_filterElapsedSecs && $qp->getElapsedSecs() < $this->_filterElapsedSecs) { unset($this->_queryProfiles[$queryId]); - return; + return self::IGNORED; } /** @@ -330,8 +339,10 @@ class Zend_Db_Profiler */ if (null !== $this->_filterTypes && !($qp->getQueryType() & $this->_filterTypes)) { unset($this->_queryProfiles[$queryId]); - return; + return self::IGNORED; } + + return self::STORED; } /** @@ -348,7 +359,7 @@ class Zend_Db_Profiler /** * @see Zend_Db_Profiler_Exception */ - require_once 'Zend/Db/Profiler/Exception.php'; + // require_once 'Zend/Db/Profiler/Exception.php'; throw new Zend_Db_Profiler_Exception("Query handle '$queryId' not found in profiler log."); } |