original_string: public function setProfiler($profiler)
      {
          $enabled          = null;
          $profilerClass    = $this->_defaultProfilerClass;
          $profilerInstance = null;
  
          if ($profilerIsObject = is_object($profiler)) {
              if ($profiler instanceof Zend_Db_Profiler) {
                  $profilerInstance = $profiler;
              } else if ($profiler instanceof Zend_Config) {
                  $profiler = $profiler->toArray();
              } else {
                  /**
                   * @see Zend_Db_Profiler_Exception
                   */
                  // require_once 'Zend/Db/Profiler/Exception.php';
                  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'];
              }
              if (isset($profiler['instance'])) {
                  $profilerInstance = $profiler['instance'];
              }
          } else if (!$profilerIsObject) {
              $enabled = (bool) $profiler;
          }
  
          if ($profilerInstance === null) {
              if (!class_exists($profilerClass)) {
                  // require_once 'Zend/Loader.php';
                  Zend_Loader::loadClass($profilerClass);
              }
              $profilerInstance = new $profilerClass();
          }
  
          if (!$profilerInstance instanceof Zend_Db_Profiler) {
              /** @see Zend_Db_Profiler_Exception */
              // require_once 'Zend/Db/Profiler/Exception.php';
              throw new Zend_Db_Profiler_Exception('Class ' . get_class($profilerInstance) . ' does not extend '
                  . 'Zend_Db_Profiler');
          }
  
          if (null !== $enabled) {
              $profilerInstance->setEnabled($enabled);
          }
  
          $this->_profiler = $profilerInstance;
  
          return $this;
      }
code: public function setProfiler($profiler)
      {
          $enabled          = null;
          $profilerClass    = $this->_defaultProfilerClass;
          $profilerInstance = null;
  
          if ($profilerIsObject = is_object($profiler)) {
              if ($profiler instanceof Zend_Db_Profiler) {
                  $profilerInstance = $profiler;
              } else if ($profiler instanceof Zend_Config) {
                  $profiler = $profiler->toArray();
              } else {
                  /**
                   * @see Zend_Db_Profiler_Exception
                   */
                  // require_once 'Zend/Db/Profiler/Exception.php';
                  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'];
              }
              if (isset($profiler['instance'])) {
                  $profilerInstance = $profiler['instance'];
              }
          } else if (!$profilerIsObject) {
              $enabled = (bool) $profiler;
          }
  
          if ($profilerInstance === null) {
              if (!class_exists($profilerClass)) {
                  // require_once 'Zend/Loader.php';
                  Zend_Loader::loadClass($profilerClass);
              }
              $profilerInstance = new $profilerClass();
          }
  
          if (!$profilerInstance instanceof Zend_Db_Profiler) {
              /** @see Zend_Db_Profiler_Exception */
              // require_once 'Zend/Db/Profiler/Exception.php';
              throw new Zend_Db_Profiler_Exception('Class ' . get_class($profilerInstance) . ' does not extend '
                  . 'Zend_Db_Profiler');
          }
  
          if (null !== $enabled) {
              $profilerInstance->setEnabled($enabled);
          }
  
          $this->_profiler = $profilerInstance;
  
          return $this;
      }
code_tokens: public function setProfiler ( $ profiler ) { $ enabled = null ; $ profilerClass = $ this -> _defaultProfilerClass ; $ profilerInstance = null ; if ( $ profilerIsObject = is_object ( $ profiler ) ) { if ( $ profiler instanceof Zend_Db_Profiler ) { $ profilerInstance = $ profiler ; } else if ( $ profiler instanceof Zend_Config ) { $ profiler = $ profiler -> toArray ( ) ; } else { /**
                   * @see Zend_Db_Profiler_Exception
                   */ // require_once 'Zend/Db/Profiler/Exception.php'; 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' ] ; } if ( isset ( $ profiler [ 'instance' ] ) ) { $ profilerInstance = $ profiler [ 'instance' ] ; } } else if ( ! $ profilerIsObject ) { $ enabled = ( bool ) $ profiler ; } if ( $ profilerInstance === null ) { if ( ! class_exists ( $ profilerClass ) ) { // require_once 'Zend/Loader.php'; Zend_Loader :: loadClass ( $ profilerClass ) ; } $ profilerInstance = new $ profilerClass ( ) ; } if ( ! $ profilerInstance instanceof Zend_Db_Profiler ) { /** @see Zend_Db_Profiler_Exception */ // require_once 'Zend/Db/Profiler/Exception.php'; throw new Zend_Db_Profiler_Exception ( 'Class ' . get_class ( $ profilerInstance ) . ' does not extend ' . 'Zend_Db_Profiler' ) ; } if ( null !== $ enabled ) { $ profilerInstance -> setEnabled ( $ enabled ) ; } $ this -> _profiler = $ profilerInstance ; return $ this ; }
docstring: Set the adapter's profiler object.
  
  The argument may be a boolean, an associative array, an instance of
  Zend_Db_Profiler, or an instance of Zend_Config.
  
  A boolean argument sets the profiler to enabled if true, or disabled if
  false.  The profiler class is the adapter's default profiler class,
  Zend_Db_Profiler.
  
  An instance of Zend_Db_Profiler sets the adapter's instance to that
  object.  The profiler is enabled and disabled separately.
  
  An associative array argument may contain any of the keys 'enabled',
  'class', and 'instance'. The 'enabled' and 'instance' keys correspond to the
  boolean and object types documented above. The 'class' key is used to name a
  class to use for a custom profiler. The class must be Zend_Db_Profiler or a
  subclass. The class is instantiated with no constructor arguments. The 'class'
  option is ignored when the 'instance' option is supplied.
  
  An object of type Zend_Config may contain the properties 'enabled', 'class', and
  'instance', just as if an associative array had been passed instead.
  
  @param  Zend_Db_Profiler|Zend_Config|array|boolean $profiler
  @return Zend_Db_Adapter_Abstract Provides a fluent interface
  @throws Zend_Db_Profiler_Exception if the object instance or class specified
  is not Zend_Db_Profiler or an extension of that class.
docstring_tokens: Set the adapter s profiler object .