Ejemplo n.º 1
0
 /**
  * Acquires a lock so only this thread reloads the WURFL data, returns false if it cannot be acquired
  *
  * @return bool
  */
 public function acquireLock()
 {
     if ($this->adapter->hasItem(self::WURFL_LOCKED)) {
         return false;
     }
     return $this->save(self::WURFL_LOCKED, true);
 }
Ejemplo n.º 2
0
 /**
  * Test if an item exists.
  *
  * @param string $cacheId
  * @param bool   $withVersion
  *
  * @return bool
  */
 public function hasItem($cacheId, $withVersion = true)
 {
     if ($withVersion) {
         $cacheId .= '.' . $this->getVersion();
     }
     return $this->cache->hasItem($cacheId);
 }