Beispiel #1
0
 /**
  * Save a value to the datastore.
  *
  * @param string $type  The datatype.
  * @param string $key  The key.
  * @param mixed $value  The value.
  * @param int|NULL $expire  The expiration time (unix timestamp), or NULL if it never expires.
  */
 public function set($type, $key, $value, $expire = NULL)
 {
     assert('is_string($type)');
     assert('is_string($key)');
     assert('is_null($expire) || (is_int($expire) && $expire > 2592000)');
     SimpleSAML_Memcache::set('simpleSAMLphp.' . $type . '.' . $key, $value, $expire);
 }
Beispiel #2
0
 /**
  * Save a value to the datastore.
  *
  * @param string $type  The datatype.
  * @param string $key  The key.
  * @param mixed $value  The value.
  * @param int|NULL $expire  The expiration time (unix timestamp), or NULL if it never expires.
  */
 public function set($type, $key, $value, $expire = null)
 {
     assert('is_string($type)');
     assert('is_string($key)');
     assert('is_null($expire) || (is_int($expire) && $expire > 2592000)');
     if ($expire === null) {
         $expire = 0;
     }
     SimpleSAML_Memcache::set($this->prefix . '.' . $type . '.' . $key, $value, $expire);
 }
 /**
  * @group integration
  * @group memcached
  */
 public function testGetNonObject()
 {
     $store = new \sspmod_oauth2server_Store_MemCacheStore(array('prefix' => 'dummy'));
     $object = 'blah';
     \SimpleSAML_Memcache::set('dummy.blah', $object, time() + 1000);
     $object = $store->getObject('blah');
     $this->assertNull($object);
 }
 public function addTicket(array $ticket)
 {
     $scopedTicketId = $this->scopeTicketId($ticket['id']);
     SimpleSAML_Memcache::set($scopedTicketId, $ticket, $ticket['validBefore']);
 }
 public function updateObject(array $object)
 {
     $scopedId = $this->scopeId($object['id']);
     SimpleSAML_Memcache::set($scopedId, $object, $object['expire']);
 }
Beispiel #6
0
 protected static function cacheSET($calID, $freebusy)
 {
     return SimpleSAML_Memcache::set('calendar-' . $calID, json_encode($freebusy));
 }
Beispiel #7
0
 /**
  * This function stores this storage object to the memcache servers.
  */
 public function save()
 {
     /* Write to the memcache servers. */
     SimpleSAML_Memcache::set($this->id, serialize($this));
 }