/** * This constructor is executed in a very early stage, during @see Mage_Core_Model_App->initCache() * Only few things of the Magento framework will be initialized at this time. * * {@inheritdoc} */ public function __construct($options) { if ($this->isAdmin()) { if (empty($options['read_timeout']) || $options['read_timeout'] < self::ADMIN_READ_TIMEOUT) { $options['read_timeout'] = self::ADMIN_READ_TIMEOUT; } } try { parent::__construct($options); $this->works = true; } catch (CredisException $e) { $this->processRedisException($e, 'constructor'); } catch (RedisException $e) { $this->processRedisException($e, 'constructor'); } catch (Zend_Cache_Exception $e) { $this->processRedisException($e, 'constructor'); } if (!$this->works) { $message = 'JeroenVermeulen_Cm_Cache_Backend_Redis: Disabled Redis cache backend because constructor failed'; Mage::log($message, Zend_Log::ERR, 'exception.log'); } }
/** * This constructor is executed in a very early stage, during @see Mage_Core_Model_App->initCache() * Only few things of the Magento framework will be initialized at this time. * * {@inheritdoc} */ public function __construct($options) { if ($this->isAdmin()) { if (empty($options['read_timeout']) || $options['read_timeout'] < self::ADMIN_READ_TIMEOUT) { $options['read_timeout'] = self::ADMIN_READ_TIMEOUT; } } try { parent::__construct($options); $this->works = true; } catch (CredisException $e) { $this->processRedisException($e, 'constructor'); } catch (RedisException $e) { $this->processRedisException($e, 'constructor'); } catch (Zend_Cache_Exception $e) { $this->processRedisException($e, 'constructor'); } if (!$this->works) { // We can't use Zend_Log here because it may not be loaded yet. error_log(sprintf('%s: Disabled Redis cache backend because constructor failed', __CLASS__)); } }