Beispiel #1
0
 /**
  *
  * @param string $string
  * @param string $language
  * @return string
  */
 public function translate($string, $language)
 {
     $key = "{$string}-to-{$language}";
     if ($this->cache->exists($key)) {
         return $this->cache->load($key);
     }
     if ($this->hasTranslate($string, $language)) {
         $strings = $this->getDBStrings($language);
         $string = $strings[$string];
         $this->cache->save($key, $string);
     }
     return $string;
 }
Beispiel #2
0
 /**
  *
  */
 public function remove($key)
 {
     $this->primaryStorage->remove($key);
     $this->secondaryStorage->remove($key);
 }
Beispiel #3
0
 /**
  *
  */
 public function removeAllCache()
 {
     $this->cache->removeAll();
 }
Beispiel #4
0
 /**
  * Elimina el cache
  * @return unknown_type
  */
 public function clearCache()
 {
     $this->cache->remove('acl');
 }