Пример #1
0
 /**
  * Builds a hash of the owner and client for identification
  * purposes
  *
  * @param Storable $owner the Storable object representing the resource
  * owner
  * @param Storable $client the Storable object representing the
  * client
  * @return string the hash
  */
 public static function buildID($owner, $client)
 {
     $owner_id = $owner->getStoreType() . ':' . $owner->getStoreID();
     $client_id = $client->getStoreType() . ':' . $client->getStoreID();
     $opaque = new OpaqueIdentifier();
     return $opaque->generate($owner_id . ':' . $client_id);
 }
Пример #2
0
 /**
  * Deletes item data.
  *
  * This data is stored in the store file.
  *
  * @param string $type the item type
  * @param Storable $item the item to delete
  */
 public function delete($type, $item)
 {
     $cache_name = $type . ':' . $item->getStoreID();
     $store = $this->getStore($type . ':write');
     if (isset($this->cache[$cache_name])) {
         unset($this->cache[$cache_name]);
     }
     $store->delete($type, $item->getStoreID());
 }