Exemplo n.º 1
0
 /**
  * Saves the object
  *
  * @param string $objectId
  * @param mixed  $object
  * @param int    $expiration If supported by the provider, this is used to specify the expiration
  *
  * @return bool
  */
 public function save($objectId, $object, $expiration = null)
 {
     if (null !== $expiration) {
         $this->adapter->setExpiration($expiration);
     }
     return $this->adapter->setItem($objectId, $object);
 }
Exemplo n.º 2
0
 /**
  * Constructor class, checks for the existence of (and loads) the cache and
  * if needed updated the definitions
  *
  * @param \WurflCache\Adapter\AdapterInterface $adapter
  * @param int                                  $updateInterval
  */
 public function __construct(AdapterInterface $adapter, $updateInterval = BrowscapCacheInterface::CACHE_LIVETIME)
 {
     $this->cache = $adapter;
     $this->cache->setExpiration((int) $updateInterval);
 }