Example #1
0
 /**
  * Store data.
  * If expiration time set in seconds it must be not greater then 2592000 (30 days).
  * @param string $key The key that will be associated with the item
  * @param string $value The variable to store
  * @param integer $expire Expiration time of the item. Unix timestamp or number of seconds
  */
 public function set($key, $value, $expire = null)
 {
     MultiCache::set($key, $value, $expire);
     // Get file name
     $fname = $this->getPathByKey($key, true);
     // Create file and save new data
     if (!($fh = fopen($fname, 'wb'))) {
         throw new Exception("File {$fname} not created!");
     }
     flock($fh, LOCK_EX);
     fwrite($fh, $value);
     flock($fh, LOCK_UN);
     fclose($fh);
 }
Example #2
0
 /**
  * Store data
  * @param string $key The key that will be associated with the item
  * @param mixed $value The variable to store
  * @param integer $expire Expiration time of the item. Unix timestamp or number of seconds
  */
 public function set($key, $value, $expire = 0)
 {
     parent::set($key, $value, $expire);
     $this->getMemcache()->set($this->domain . $key, $value, false, $expire);
 }
Example #3
0
 /**
  * Stores data.
  *
  * @param string  $key    The key that will be associated with the item.
  * @param mixed   $value  The variable to store.
  * @param integer $expire Expiration time of the item. Unix timestamp
  *                        or number of seconds.
  */
 public function set($key, $value, $expire = 0)
 {
     parent::set($key, $value, $expire);
     $this->memcache->set($key, $value, false, $expire);
 }