Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param  array $options Associative array of options
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     if (is_null($this->_options['slow_backend'])) {
         Zend_Cache::throwException('slow_backend option has to set');
     }
     if (is_null($this->_options['fast_backend'])) {
         Zend_Cache::throwException('fast_backend option has to set');
     }
     $this->_slowBackend = Zend_Cache::_makeBackend($this->_options['slow_backend'], $this->_options['slow_backend_options'], $this->_options['slow_backend_custom_naming'], $this->_options['slow_backend_autoload']);
     $this->_fastBackend = Zend_Cache::_makeBackend($this->_options['fast_backend'], $this->_options['fast_backend_options'], $this->_options['fast_backend_custom_naming'], $this->_options['fast_backend_autoload']);
     if (!in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_slowBackend))) {
         Zend_Cache::throwException('slow_backend must implement the Zend_Cache_Backend_ExtendedInterface interface');
     }
     if (!in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_fastBackend))) {
         Zend_Cache::throwException('slow_backend must implement the Zend_Cache_Backend_ExtendedInterface interface');
     }
     $this->_slowBackend->setDirectives($this->_directives);
     $this->_fastBackend->setDirectives($this->_directives);
 }
Ejemplo n.º 2
0
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime > 2592000) {
         // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)
         $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime');
     }
     if ($lifetime === null) {
         // #ZF-4614 : we tranform null to zero to get the maximal lifetime
         parent::setDirectives(array('lifetime' => 0));
     }
 }
Ejemplo n.º 3
0
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime > 2592000) {
         # ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)
         $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime');
     }
 }
Ejemplo n.º 4
0
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws \Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime === null) {
         // #ZF-4614 : we tranform null to zero to get the maximal lifetime
         parent::setDirectives(array('lifetime' => 0));
     }
     return $this;
 }
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime > self::MAX_LIFETIME) {
         Zend_Cache::throwException('Redis backend has a limit of 30 days (2592000 seconds) for the lifetime');
     }
 }
 /**
  * Set the frontend directives
  *
  * @param array $directives assoc of directives
  * @return void
  */
 public function setDirectives($directives)
 {
     $this->_backend->setDirectives($directives);
 }
Ejemplo n.º 7
0
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime > self::MAX_LIFETIME) {
         $this->_log('redis backend has a limit of 30 days (' . self::MAX_LIFETIME . ' seconds) for the lifetime');
     }
 }
Ejemplo n.º 8
0
 /**
  * Set the frontend directives
  *
  * @param  array $directives Assoc of directives
  * @throws Zend_Cache_Exception
  * @return void
  */
 public function setDirectives($directives)
 {
     parent::setDirectives($directives);
     $lifetime = $this->getLifetime(false);
     if ($lifetime > 2592000) {
         $this->_log('redis backend has a limit of 30 days (2592000 seconds) for the lifetime');
     }
 }