Пример #1
0
 /**
  * Set options
  *
  * Overrides any existing values.
  * 
  * If the options array has an 'options' entry it is forwarded to the
  * Zend_Http_Client. See the Zend_Http_Clientdocs for the many config
  * options available.
  *
  * The $options param should be an array or an object that has a toArray
  * method, like Zend_Config
  *
  * @param array|object $options
  * @param boolean $overwrite
  * @return Solarium_Client_Adapter_ZendHttp Provides fluent interface
  */
 public function setOptions($options, $overwrite = false)
 {
     parent::setOptions($options, $overwrite);
     // forward options to zendHttp instance
     if (null !== $this->_zendHttp) {
         // forward timeout setting
         $adapterOptions = array('timeout' => $this->getTimeout());
         // forward adapter options if available
         if (isset($this->_options['options'])) {
             $adapterOptions = array_merge($adapterOptions, $this->_options['options']);
         }
         $this->_zendHttp->setConfig($adapterOptions);
     }
     return $this;
 }
Пример #2
0
 /**
  * Create an adapter instance
  *
  * The 'adapter' entry in {@link $_options} will be used to create an
  * adapter instance. This entry can be the default value of
  * {@link $_options}, a value passed to the constructor or a value set by
  * using {@link setAdapter()}
  *
  * This method is used for lazy-loading the adapter upon first use in
  * {@link getAdapter()}
  *
  * @return void
  */
 protected function _createAdapter()
 {
     $adapterClass = $this->getOption('adapter');
     $this->_adapter = new $adapterClass();
     $this->_adapter->setOptions($this->getOption('adapteroptions'));
 }