Exemplo n.º 1
0
 /**
  * Read a specific session
  *
  * @param int $id Session Id
  * @return string
  */
 public function read($id)
 {
     // Read data
     if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
         // In table storage
         try {
             $sessionRecord = $this->_storage->retrieveEntityById($this->_sessionContainer, $this->_sessionContainerPartition, $id);
             return unserialize(base64_decode($sessionRecord->serializedData));
         } catch (Zend_Service_WindowsAzure_Exception $ex) {
             return '';
         }
     } elseif ($this->_storageType == self::STORAGE_TYPE_BLOB) {
         // In blob storage
         try {
             $data = $this->_storage->getBlobData($this->_sessionContainer, $this->_sessionContainerPartition . '/' . $id);
             return unserialize(base64_decode($data));
         } catch (Zend_Service_WindowsAzure_Exception $ex) {
             return false;
         }
     }
 }