/** * Create me */ function __construct($params = array()) { if (!function_exists('apc_store')) { throw new Exception('Apc extension not loaded'); } return parent::__construct($params); }
function getLastNotificationId($username = null) { $lastNotificationId = MultiCache::cache_get('lastNotificationId'); if (!is_array($lastNotificationId)) { $lastNotificationId = array(); } if (!is_null($username)) { if (isset($lastNotificationId[$username])) { return $lastNotificationId[$username]; } else { return FALSE; } } return $lastNotificationId; }
/** * 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); }
/** * 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); }
/** * 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); }