/** * 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); }
/** * 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); }