Example #1
0
 /**
  * @param array $params
  */
 protected function toFields(array $params)
 {
     parent::toFields($params);
     if (isset($params['host'])) {
         $this->host = $params['host'];
     }
     if (isset($params['port'])) {
         $this->port = $params['port'];
     }
 }
 /**
  * normalizes the cache id for zend cache
  *
  * @param string $cacheId The cache id
  *
  * @return string The formated cache id
  */
 protected function normalizeKey($cacheId)
 {
     $cacheId = parent::normalizeKey($cacheId);
     if (($pattern = $this->cache->getOptions()->getKeyPattern()) && !preg_match($pattern, $cacheId)) {
         $pattern = str_replace(array('^[', '*$'), array('[^', ''), $pattern);
         $cacheId = preg_replace($pattern, '_', $cacheId);
     }
     return $cacheId;
 }