/** * add container from its url * @param type $url * @param type $access * @param array $metadata * @return boolean */ public function addContainer($url, $access = 'cb', array $metadata = array()) { try { $dir = $this->getContainer($url); } catch (Exception $ex) { echo $ex->getMessage(); } try { return parent::createContainer($dir, $access, $metadata); } catch (ServiceException $e) { // Handle exception based on error codes and messages. // Error codes and messages are here: // http://msdn.microsoft.com/it-it/library/windowsazure/dd179439.aspx $code = $e->getCode(); $error_message = $e->getMessage(); echo $code . ": " . $error_message . "<br />"; return false; } }
/** * create a container * @param type $dir name of container * @param type $access can be cb(CONTAINER_AND_BLOBS) or b (BLOBS_ONLY) * CONTAINER_AND_BLOBS: * Specifies full public read access for container and blob data. * proxys can enumerate blobs within the container via anonymous * request, but cannot enumerate containers within the storage account. * * BLOBS_ONLY: * Specifies public read access for blobs. Blob data within this * container can be read via anonymous request, but container data is not * available. proxys cannot enumerate blobs within the container via * anonymous request. * If this value is not specified in the request, container data is * private to the account owner. * @return boolean */ public function mkdir($dir, $access = 'cb', array $metadata = array()) { return parent::createContainer($dir, $access, $metadata); }