本文整理匯總了PHP中Zend_Service_WindowsAzure_Storage_Table::createTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Service_WindowsAzure_Storage_Table::createTable方法的具體用法?PHP Zend_Service_WindowsAzure_Storage_Table::createTable怎麽用?PHP Zend_Service_WindowsAzure_Storage_Table::createTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Service_WindowsAzure_Storage_Table
的用法示例。
在下文中一共展示了Zend_Service_WindowsAzure_Storage_Table::createTable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: open
/**
* 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;
}
示例2: createCollection
/**
* 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;
}