Example #1
0
 /**
  * Create me
  */
 function __construct($params = array())
 {
     if (!function_exists('apc_store')) {
         throw new Exception('Apc extension not loaded');
     }
     return parent::__construct($params);
 }
Example #2
0
File: aaa.php Project: ram-1501/rs
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;
}
Example #3
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 #4
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 #5
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);
 }