Zend_Db_Profiler_Exception example

$profilerInstance = null;

        if ($profilerIsObject = is_object($profiler)) {
            if ($profiler instanceof Zend_Db_Profiler) {
                $profilerInstance = $profiler;
            } elseif ($profiler instanceof Zend_Config) {
                $profiler = $profiler->toArray();
            } else {
                /* * @see Zend_Db_Profiler_Exception */
                throw new Zend_Db_Profiler_Exception('Profiler argument must be an instance of either Zend_Db_Profiler'
                    . ' or Zend_Config when provided as an object');
            }
        }

        if (is_array($profiler)) {
            if (isset($profiler['enabled'])) {
                $enabled = (bool) $profiler['enabled'];
            }
            if (isset($profiler['class'])) {
                $profilerClass = $profiler['class'];
            }
            

        // Don't do anything if the Zend_Db_Profiler is not enabled.         if (!$this->_enabled) {
            return self::IGNORED;
        }

        // Check for a valid query handle.         if (!isset($this->_queryProfiles[$queryId])) {
            /** * @see Zend_Db_Profiler_Exception */
            throw new Zend_Db_Profiler_Exception("Profiler has no query with handle '$queryId'.");
        }

        $qp = $this->_queryProfiles[$queryId];

        // Ensure that the query profile has not already ended         if ($qp->hasEnded()) {
            /** * @see Zend_Db_Profiler_Exception */
            throw new Zend_Db_Profiler_Exception("Query with profiler handle '$queryId' has already ended.");
        }

        
Home | Imprint | This part of the site doesn't use cookies.