コード例 #1
0
ファイル: SessionHandler.php プロジェクト: Cryde/sydney-core
 /**
  * Destroy a specific session
  *
  * @param int $id Session Id
  * @return boolean
  */
 public function destroy($id)
 {
     // Destroy data
     if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
         // In table storage
         try {
             $sessionRecord = $this->_storage->retrieveEntityById($this->_sessionContainer, $this->_sessionContainerPartition, $id);
             $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
             return true;
         } catch (Zend_Service_WindowsAzure_Exception $ex) {
             return false;
         }
     } elseif ($this->_storageType == self::STORAGE_TYPE_BLOB) {
         // In blob storage
         try {
             $this->_storage->deleteBlob($this->_sessionContainer, $this->_sessionContainerPartition . '/' . $id);
             return true;
         } catch (Zend_Service_WindowsAzure_Exception $ex) {
             return false;
         }
     }
 }