/** * Open the session store * * @return bool */ public function open() { // Make sure table exists $tableExists = $this->_tableStorage->tableExists($this->_sessionTable); if (!$tableExists) { $this->_tableStorage->createTable($this->_sessionTable); } // Ok! return true; }
/** * Create collection. * * @param string $name * @param array $options * @return boolean */ public function createCollection($name, $options = null) { if (!preg_match('/^[A-Za-z][A-Za-z0-9]{2,}$/', $name)) { throw new Zend_Cloud_DocumentService_Exception('Invalid collection name; Windows Azure collection names must consist of alphanumeric characters only, and be at least 3 characters long'); } try { $this->_storageClient->createTable($name); } catch (Zend_Service_WindowsAzure_Exception $e) { if (strpos($e->getMessage(), "table specified already exists") === false) { throw new Zend_Cloud_DocumentService_Exception('Error on collection creation: ' . $e->getMessage(), $e->getCode(), $e); } } return true; }