From 9a8c8a8f03ddbf5d3fa83927b6af112967a99fa2 Mon Sep 17 00:00:00 2001 From: "Vincent Jiang (LEI)" Date: Thu, 26 Apr 2018 15:38:33 +0800 Subject: [PATCH] source code copied from azure-storage-php for v1.1.0-blob release --- .gitignore | 288 --------------- ChangeLog.md | 10 + README.md | 97 +++-- composer.json | 4 +- src/Blob/BlobRestProxy.php | 349 +++++++++--------- src/Blob/Internal/BlobResources.php | 2 +- src/Blob/Internal/IBlob.php | 20 +- src/Blob/Models/AccessCondition.php | 34 +- src/Blob/Models/AppendBlockOptions.php | 8 +- src/Blob/Models/Blob.php | 6 +- src/Blob/Models/BlobAccessPolicy.php | 2 +- src/Blob/Models/BlobBlockType.php | 6 +- src/Blob/Models/BlobPrefix.php | 4 +- src/Blob/Models/BlobProperties.php | 32 +- src/Blob/Models/BlobServiceOptions.php | 10 +- src/Blob/Models/BlobType.php | 2 +- src/Blob/Models/Block.php | 10 +- src/Blob/Models/BlockList.php | 30 +- src/Blob/Models/BreakLeaseResult.php | 12 +- src/Blob/Models/CommitBlobBlocksOptions.php | 18 +- src/Blob/Models/Container.php | 6 +- src/Blob/Models/ContainerACL.php | 2 +- src/Blob/Models/ContainerAccessPolicy.php | 2 +- src/Blob/Models/ContainerProperties.php | 10 +- src/Blob/Models/CopyBlobFromURLOptions.php | 8 +- src/Blob/Models/CopyBlobOptions.php | 4 +- src/Blob/Models/CopyBlobResult.php | 18 +- src/Blob/Models/CopyState.php | 46 +-- src/Blob/Models/CreateBlobBlockOptions.php | 4 +- src/Blob/Models/CreateBlobOptions.php | 22 +- src/Blob/Models/CreateBlobPagesOptions.php | 4 +- src/Blob/Models/CreateBlobPagesResult.php | 10 +- src/Blob/Models/CreateBlobSnapshotOptions.php | 4 +- src/Blob/Models/CreateBlobSnapshotResult.php | 20 +- src/Blob/Models/CreateBlockBlobOptions.php | 2 +- src/Blob/Models/CreateContainerOptions.php | 12 +- .../CreatePageBlobFromContentOptions.php | 2 +- src/Blob/Models/DeleteBlobOptions.php | 6 +- src/Blob/Models/GetBlobMetadataOptions.php | 4 +- src/Blob/Models/GetBlobMetadataResult.php | 2 +- src/Blob/Models/GetBlobOptions.php | 4 +- src/Blob/Models/GetBlobPropertiesOptions.php | 4 +- src/Blob/Models/GetBlobPropertiesResult.php | 6 +- src/Blob/Models/GetBlobResult.php | 12 +- src/Blob/Models/GetContainerACLResult.php | 12 +- .../Models/GetContainerPropertiesResult.php | 8 +- src/Blob/Models/LeaseMode.php | 2 +- src/Blob/Models/LeaseResult.php | 12 +- src/Blob/Models/ListBlobBlocksOptions.php | 20 +- src/Blob/Models/ListBlobBlocksResult.php | 34 +- src/Blob/Models/ListBlobsOptions.php | 10 +- src/Blob/Models/ListBlobsResult.php | 26 +- src/Blob/Models/ListContainersOptions.php | 2 +- src/Blob/Models/ListContainersResult.php | 12 +- .../Models/ListPageBlobRangesDiffResult.php | 6 +- src/Blob/Models/ListPageBlobRangesOptions.php | 4 +- src/Blob/Models/ListPageBlobRangesResult.php | 20 +- src/Blob/Models/PageWriteOption.php | 2 +- src/Blob/Models/PublicAccessType.php | 4 +- src/Blob/Models/PutBlockResult.php | 4 +- src/Blob/Models/SetBlobMetadataResult.php | 4 +- src/Blob/Models/SetBlobPropertiesOptions.php | 28 +- src/Blob/Models/SetBlobPropertiesResult.php | 10 +- 63 files changed, 563 insertions(+), 815 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 940794e..0000000 --- a/.gitignore +++ /dev/null @@ -1,288 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Typescript v1 declaration files -typings/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs diff --git a/ChangeLog.md b/ChangeLog.md index 29ad42b..f447ee1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,13 @@ +2018.04 - version 1.1.0 + +* Private method BlobRestProxy::getBlobUrl now preserves primary URI path when exists. +* MD files are modified for better readability and formatting. +* CACERT can now be set when creating RestProxies using `$options` parameter. +* Added a sample in `BlobSamples.php` to list all blobs with certain prefix. This is a recommended implementation of using continuation token to list all the blobs. +* Removed unnecessary trailing spaces. +* Assertions are re-factored in test cases. +* Now the test framework uses `PHPUnit\Framework\TestCase` instead of `PHPUnit_Framework_TestCase`. + 2018.01 - version 1.0.0 * Created `BlobSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`. diff --git a/README.md b/README.md index fef071c..ee45167 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This project provides a PHP client library that makes it easy to access Microsof [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-blob/v/stable)](https://packagist.org/packages/microsoft/azure-storage-blob) > **Note** -> +> > * This [repository](https://github.com/azure/azure-storage-blob-php) is currently used for releasing only, please go to [azure-storage-php](https://github.com/azure/azure-storage-php) for submitting issues or contribution. > * If you are looking for the Service Bus, Service Runtime, Service Management or Media Services libraries, please visit https://github.com/Azure/azure-sdk-for-php. > * If you need big file (larger than 2GB) or 64-bit integer support, please install PHP 7 64-bit version. @@ -25,70 +25,82 @@ Please check details on [API reference documents](http://azure.github.io/azure-s * PHP 5.6 or above * See [composer.json](composer.json) for dependencies * Required extension for PHP: - php_fileinfo.dll - php_mbstring.dll - php_openssl.dll - php_xsl.dll + * php_fileinfo.dll + * php_mbstring.dll + * php_openssl.dll + * php_xsl.dll * Recommended extension for PHP: - php_curl.dll + * php_curl.dll ## Download Source Code To get the source code from GitHub, type - git clone https://github.com/Azure/azure-storage-php.git - cd ./azure-storage-php - +``` +git clone https://github.com/Azure/azure-storage-php.git +cd ./azure-storage-php +``` ## Install via Composer 1. Create a file named **composer.json** in the root of your project and add the following code to it: ```json - { - "require": { - "microsoft/azure-storage-blob": "*" - } - } +{ + "require": { + "microsoft/azure-storage-blob": "*" + } +} ``` 2. Download **[composer.phar](http://getcomposer.org/composer.phar)** in your project root. 3. Open a command prompt and execute this in your project root - php composer.phar install +``` +php composer.phar install +``` ## Usage -There are four basic steps that have to be performed before you can make a call to any Microsoft Azure Storage API when using the libraries. +There are four basic steps that have to be performed before you can make a call to any Microsoft Azure Storage API when using the libraries. * First, include the autoloader script: - - require_once "vendor/autoload.php"; - + +```php +require_once "vendor/autoload.php"; +``` + * Include the namespaces you are going to use. To create any Microsoft Azure service client you need to use the rest proxy classes, such as **BlobRestProxy** class: - use MicrosoftAzure\Storage\Blob\BlobRestProxy; +```php +use MicrosoftAzure\Storage\Blob\BlobRestProxy; +``` To process exceptions you need: - use MicrosoftAzure\Storage\Common\ServiceException; +```php +use MicrosoftAzure\Storage\Common\ServiceException; +``` + +* To instantiate the service client you will also need a valid [connection string](https://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/). The format is: - -* To instantiate the service client you will also need a valid [connection string](https://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/). The format is: +``` +DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey] +``` - DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey] - or: - - BlobEndpoint=[myBlobEndpoint];SharedAccessSignature=[sasToken] + +``` +BlobEndpoint=[myBlobEndpoint];SharedAccessSignature=[sasToken] +``` * Instantiate a client object - a wrapper around the available calls for the given service. - ```PHP - $blobClient = BlobRestProxy::createBlobService($connectionString); - ``` +```php +$blobClient = BlobRestProxy::createBlobService($connectionString); +``` ### Using Middlewares To specify the middlewares, user have to create an array with middlewares and put it in the `$requestOptions` with key 'middlewares'. The sequence of @@ -101,7 +113,7 @@ services' `$_options` instead when creating them if the middleware is to be applied to each of the API call for a rest proxy. These middlewares will always be invoked after the middlewares in the `$requestOptions`. e.g.: -``` +```php $blobClient = BlobRestProxy::createBlobService( $connectionString, $optionsWithMiddlewares @@ -121,12 +133,19 @@ To use proxies during HTTP requests, set system variable `HTTP_PROXY` and the pr ### Error: Unable to get local issuer certificate cURL can't verify the validity of Microsoft certificate when trying to issue a request call to Azure Storage Services. You must configure cURL to use a certificate when issuing https requests by the following steps: -1. Download the cacert.pem file from [cURL site](http://curl.haxx.se/docs/caextract.html). -2. Open your php.ini file and add the following line: +1. Download the cacert.pem file from [cURL site](http://curl.haxx.se/docs/caextract.html). - ``` - curl.cainfo = "" - ``` +2. Then either: + * Open your php.ini file and add the following line: + ```ini + curl.cainfo = "" + ``` + OR + * Point to the cacert in the options when creating the Proxy. + ```php + $options["http"] = ["verify" => ""]; + BlobRestProxy::createBlobService($connectionString, $options); + ``` ## Code samples @@ -138,7 +157,7 @@ You can find samples in the [sample folder](samples) If you are using [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/) to access Azure Storage Service, we highly recommend you to migrate to this SDK for faster issue resolution and quicker feature implementation. We are working on supporting the latest service features as well as improvement on existing APIs. For now, Microsoft Azure Storage PHP client libraries share almost the same interface as the storage blobs, tables, queues and files APIs in Azure SDK for PHP. However, there are some minor breaking changes need to be addressed during your migration. You can find the details in [BreakingChanges.md](BreakingChanges.md). - + # Need Help? Be sure to check out the Microsoft Azure [Developer Forums on Stack Overflow](http://go.microsoft.com/fwlink/?LinkId=234489) and [github issues](https://github.com/Azure/azure-storage-php/issues) if you have trouble with the provided code. @@ -147,5 +166,5 @@ Be sure to check out the Microsoft Azure [Developer Forums on Stack Overflow](ht If you would like to become an active contributor to this project please follow the instructions provided in [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/). You can find more details for contributing in the [CONTRIBUTING.md](CONTRIBUTING.md). - -If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-storage-php/issues) section of the project. \ No newline at end of file + +If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-storage-php/issues) section of the project. diff --git a/composer.json b/composer.json index 1b13690..7fee336 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "microsoft/azure-storage-blob", - "version": "1.0.0", + "version": "1.1.0", "description": "This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage Blob APIs.", "keywords": [ "php", "azure", "storage", "sdk", "blob" ], "license": "MIT", @@ -12,7 +12,7 @@ ], "require": { "php": ">=5.6.0", - "microsoft/azure-storage-common": "~1.0" + "microsoft/azure-storage-common": "~1.1" }, "autoload": { "psr-4": { diff --git a/src/Blob/BlobRestProxy.php b/src/Blob/BlobRestProxy.php index 8672950..3eaa8a1 100644 --- a/src/Blob/BlobRestProxy.php +++ b/src/Blob/BlobRestProxy.php @@ -334,7 +334,7 @@ private function getCopyBlobSourceName( return $sourceName; } - + /** * Creates URI path for blob or container. * @@ -367,7 +367,7 @@ private function createPath($container, $blob = '') } } } - + /** * Creates full URI to the given blob. * @@ -379,10 +379,17 @@ private function createPath($container, $blob = '') private function getBlobUrl($container, $blob) { $encodedBlob = $this->createPath($container, $blob); + $uri = $this->getPsrPrimaryUri(); + $exPath = $uri->getPath(); + + if ($exPath != '') { + //Remove the duplicated slash in the path. + $encodedBlob = str_replace('//', '/', $exPath . $encodedBlob); + } - return (string)($this->getPsrPrimaryUri()->withPath($encodedBlob)); + return (string) $uri->withPath($encodedBlob); } - + /** * Helper method to create promise for getContainerProperties API call. * @@ -399,17 +406,17 @@ private function getContainerPropertiesAsyncImpl( $operation = null ) { Validate::canCastAsString($container, 'container'); - + $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = $this->createPath($container); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -430,7 +437,7 @@ private function getContainerPropertiesAsyncImpl( $headers, $options->getAccessConditions() ); - + return $this->sendAsync( $method, $headers, @@ -445,7 +452,7 @@ private function getContainerPropertiesAsyncImpl( return GetContainerPropertiesResult::create($responseHeaders); }, null); } - + /** * Adds optional create blob headers. * @@ -462,7 +469,7 @@ private function addCreateBlobOptionalHeaders( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -514,10 +521,10 @@ private function addCreateBlobOptionalHeaders( Resources::CONTENT_TYPE, Resources::URL_ENCODED_CONTENT_TYPE ); - + return $headers; } - + /** * Adds Range header to the headers array. * @@ -534,7 +541,7 @@ private function addOptionalRangeHeader(array $headers, $start, $end) $rangeValue = 'bytes=' . $range; $this->addOptionalHeader($headers, Resources::RANGE, $rangeValue); } - + return $headers; } @@ -599,7 +606,7 @@ private function putLeaseAsyncImpl( Validate::canCastAsString($blob, 'blob'); Validate::canCastAsString($container, 'container'); Validate::notNullOrEmpty($container, 'container'); - + $method = Resources::HTTP_PUT; $headers = array(); $queryParams = array(); @@ -621,7 +628,7 @@ private function putLeaseAsyncImpl( Resources::QP_TIMEOUT, $options->getTimeout() ); - + $this->addOptionalHeader($headers, Resources::X_MS_LEASE_ID, $leaseId); $this->addOptionalHeader( $headers, @@ -648,7 +655,7 @@ private function putLeaseAsyncImpl( if (!is_null($options)) { $options = new BlobServiceOptions(); } - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -696,28 +703,28 @@ private function updatePageBlobPagesAsyncImpl( ) ); $body = Psr7\stream_for($content); - + $method = Resources::HTTP_PUT; $headers = array(); $queryParams = array(); $postParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new CreateBlobPagesOptions(); } - + $headers = $this->addOptionalRangeHeader( $headers, $range->getStart(), $range->getEnd() ); - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -739,7 +746,7 @@ private function updatePageBlobPagesAsyncImpl( Resources::URL_ENCODED_CONTENT_TYPE ); $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'page'); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -757,7 +764,7 @@ private function updatePageBlobPagesAsyncImpl( ); }, null); } - + /** * Lists all of the containers in the given storage account. * @@ -788,11 +795,11 @@ public function listContainersAsync( $queryParams = array(); $postParams = array(); $path = Resources::EMPTY_STRING; - + if (is_null($options)) { $options = new ListContainersOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_COMP, @@ -840,7 +847,7 @@ public function listContainersAsync( ); }); } - + /** * Creates a new container in the given storage account. * @@ -874,13 +881,13 @@ public function createContainerAsync( ) { Validate::canCastAsString($container, 'container'); Validate::notNullOrEmpty($container, 'container'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(Resources::QP_REST_TYPE => 'container'); $path = $this->createPath($container); - + if (is_null($options)) { $options = new CreateContainerOptions(); } @@ -894,7 +901,7 @@ public function createContainerAsync( ); $options->setLocationMode(LocationMode::PRIMARY_ONLY); - + return $this->sendAsync( $method, $headers, @@ -906,7 +913,7 @@ public function createContainerAsync( $options ); } - + /** * Deletes a container in the given storage account. * @@ -938,17 +945,17 @@ public function deleteContainerAsync( ) { Validate::canCastAsString($container, 'container'); Validate::notNullOrEmpty($container, 'container'); - + $method = Resources::HTTP_DELETE; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -958,7 +965,7 @@ public function deleteContainerAsync( $headers, $options->getAccessConditions() ); - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -978,7 +985,7 @@ public function deleteContainerAsync( $options ); } - + /** * Returns all properties and metadata on the container. * @@ -1012,7 +1019,7 @@ public function getContainerPropertiesAsync( ) { return $this->getContainerPropertiesAsyncImpl($container, $options); } - + /** * Returns only user-defined metadata for the specified container. * @@ -1047,7 +1054,7 @@ public function getContainerMetadataAsync( ) { return $this->getContainerPropertiesAsyncImpl($container, $options, 'metadata'); } - + /** * Gets the access control list (ACL) and any container-level access policies * for the container. @@ -1082,18 +1089,18 @@ public function getContainerAclAsync( Models\BlobServiceOptions $options = null ) { Validate::canCastAsString($container, 'container'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container); $statusCode = Resources::STATUS_OK; - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1116,7 +1123,7 @@ public function getContainerAclAsync( ); $dataSerializer = $this->dataSerializer; - + $promise = $this->sendAsync( $method, $headers, @@ -1130,7 +1137,7 @@ public function getContainerAclAsync( return $promise->then(function ($response) use ($dataSerializer) { $responseHeaders = HttpFormatter::formatHeaders($response->getHeaders()); - + $access = Utilities::tryGetValue( $responseHeaders, Resources::X_MS_BLOB_PUBLIC_ACCESS @@ -1142,7 +1149,7 @@ public function getContainerAclAsync( ); $modifiedDate = Utilities::convertToDateTime($modified); $parsed = $dataSerializer->unserialize($response->getBody()); - + return GetContainerAclResult::create( $access, $etag, @@ -1151,7 +1158,7 @@ public function getContainerAclAsync( ); }, null); } - + /** * Sets the ACL and any container-level access policies for the container. * @@ -1190,18 +1197,18 @@ public function setContainerAclAsync( ) { Validate::canCastAsString($container, 'container'); Validate::notNullOrEmpty($acl, 'acl'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container); $body = $acl->toXml($this->dataSerializer); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1245,7 +1252,7 @@ public function setContainerAclAsync( $options ); } - + /** * Sets metadata headers on the container. * @@ -1283,17 +1290,17 @@ public function setContainerMetadataAsync( ) { Validate::canCastAsString($container, 'container'); Utilities::validateMetadata($metadata); - + $method = Resources::HTTP_PUT; $headers = $this->generateMetadataHeaders($metadata); $postParams = array(); $queryParams = array(); $path = $this->createPath($container); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1310,7 +1317,7 @@ public function setContainerMetadataAsync( Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() @@ -1329,7 +1336,7 @@ public function setContainerMetadataAsync( $options ); } - + /** * Lists all of the blobs in the given container. * @@ -1361,17 +1368,17 @@ public function listBlobsAsync( ) { Validate::notNull($container, 'container'); Validate::canCastAsString($container, 'container'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container); - + if (is_null($options)) { $options = new ListBlobsOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1402,12 +1409,12 @@ public function listBlobsAsync( Resources::QP_MAX_RESULTS, $options->getMaxResults() ); - + $includeMetadata = $options->getIncludeMetadata(); $includeSnapshots = $options->getIncludeSnapshots(); $includeUncommittedBlobs = $options->getIncludeUncommittedBlobs(); $includecopy = $options->getIncludeCopy(); - + $includeValue = static::groupQueryValues( array( $includeMetadata ? 'metadata' : null, @@ -1416,7 +1423,7 @@ public function listBlobsAsync( $includecopy ? 'copy' : null ) ); - + $this->addOptionalQueryParam( $queryParams, Resources::QP_INCLUDE, @@ -1442,7 +1449,7 @@ public function listBlobsAsync( ); }, null); } - + /** * Creates a new page blob. Note that calling createPageBlob to create a page * blob only initializes the blob. @@ -1504,17 +1511,17 @@ public function createPageBlobAsync( Validate::notNullOrEmpty($blob, 'blob'); Validate::isInteger($length, 'length'); Validate::notNull($length, 'length'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new CreateBlobOptions(); } - + $this->addOptionalHeader( $headers, Resources::X_MS_BLOB_TYPE, @@ -1531,7 +1538,7 @@ public function createPageBlobAsync( $options->getSequenceNumber() ); $headers = $this->addCreateBlobOptionalHeaders($options, $headers); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -1549,7 +1556,7 @@ public function createPageBlobAsync( ); }, null); } - + /** * Create a new append blob. * If the blob already exists on the service, it will be overwritten. @@ -1606,7 +1613,7 @@ public function createAppendBlobAsync( if (is_null($options)) { $options = new CreateBlobOptions(); } - + $this->addOptionalHeader( $headers, Resources::X_MS_BLOB_TYPE, @@ -1631,7 +1638,7 @@ public function createAppendBlobAsync( ); }, null); } - + /** * Creates a new block blob or updates the content of an existing block blob. * @@ -1859,7 +1866,7 @@ protected function createBlockBlobBySingleUploadAsync( get_class(new CreateBlobOptions()) ) ); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); @@ -1869,9 +1876,9 @@ protected function createBlockBlobBySingleUploadAsync( if (is_null($options)) { $options = new CreateBlobOptions(); } - + $headers = $this->addCreateBlobOptionalHeaders($options, $headers); - + $this->addOptionalHeader( $headers, Resources::X_MS_BLOB_TYPE, @@ -2058,7 +2065,7 @@ private function uploadPageBlobAsync( if (is_null($options)) { $options = new Models\CreatePageBlobFromContentOptions(); } - + $method = Resources::HTTP_PUT; $postParams = array(); $queryParams = array(); @@ -2097,10 +2104,10 @@ private function uploadPageBlobAsync( if ($size == 0) { return null; } - + $end += $size; $start = ($end - $size + 1); - + // If all Zero, skip this range } while (Utilities::allZero($pageContent)); @@ -2155,7 +2162,7 @@ private function uploadPageBlobAsync( $options ); } - + /** * Clears a range of pages from the blob. * @@ -2217,7 +2224,7 @@ public function clearBlobPagesAsync( $options ); } - + /** * Creates a range of pages to a page blob. * @@ -2293,7 +2300,7 @@ public function createBlobPagesAsync( $options ); } - + /** * Creates a new block to be committed as part of a block blob. * @@ -2366,7 +2373,7 @@ public function createBlobBlockAsync( if (is_null($options)) { $options = new CreateBlobBlockOptions(); } - + $method = Resources::HTTP_PUT; $headers = $this->createBlobBlockHeader($options); $postParams = array(); @@ -2375,7 +2382,7 @@ public function createBlobBlockAsync( $statusCode = Resources::STATUS_CREATED; $contentStream = Psr7\stream_for($content); $body = $contentStream->getContents(); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -2393,7 +2400,7 @@ public function createBlobBlockAsync( ); }); } - + /** * Commits a new block of data to the end of an existing append blob. * @@ -2447,7 +2454,7 @@ public function appendBlockAsync( if (is_null($options)) { $options = new AppendBlockOptions(); } - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); @@ -2464,7 +2471,7 @@ public function appendBlockAsync( Resources::QP_COMP, 'appendblock' ); - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() @@ -2495,7 +2502,7 @@ public function appendBlockAsync( Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -2577,7 +2584,7 @@ protected function createBlobBlockQueryParams( $options->getTimeout() ); } - + return $queryParams; } @@ -2652,7 +2659,7 @@ public function commitBlobBlocksAsync( get_class(new BlockList()) ) ); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); @@ -2661,11 +2668,11 @@ public function commitBlobBlocksAsync( $isArray = is_array($blockList); $blockList = $isArray ? BlockList::create($blockList) : $blockList; $body = $blockList->toXml($this->dataSerializer); - + if (is_null($options)) { $options = new CommitBlobBlocksOptions(); } - + $blobContentType = $options->getContentType(); $blobContentEncoding = $options->getContentEncoding(); $blobContentLanguage = $options->getContentLanguage(); @@ -2674,14 +2681,14 @@ public function commitBlobBlocksAsync( $blobCcontentDisposition = $options->getContentDisposition(); $leaseId = $options->getLeaseId(); $contentType = Resources::URL_ENCODED_CONTENT_TYPE; - + $metadata = $options->getMetadata(); $headers = $this->generateMetadataHeaders($metadata); $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -2722,13 +2729,13 @@ public function commitBlobBlocksAsync( Resources::CONTENT_TYPE, $contentType ); - + $this->addOptionalQueryParam( $queryParams, Resources::QP_COMP, 'blocklist' ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -2746,7 +2753,7 @@ public function commitBlobBlocksAsync( ); }, null); } - + /** * Retrieves the list of blocks that have been uploaded as part of a block blob. * @@ -2802,23 +2809,23 @@ public function listBlobBlocksAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new ListBlobBlocksOptions(); } - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $this->addOptionalQueryParam( $queryParams, Resources::QP_BLOCK_LIST_TYPE, @@ -2834,7 +2841,7 @@ public function listBlobBlocksAsync( Resources::QP_COMP, 'blocklist' ); - + return $this->sendAsync( $method, $headers, @@ -2846,14 +2853,14 @@ public function listBlobBlocksAsync( $options )->then(function ($response) { $parsed = $this->dataSerializer->unserialize($response->getBody()); - + return ListBlobBlocksResult::create( HttpFormatter::formatHeaders($response->getHeaders()), $parsed ); }, null); } - + /** * Returns all properties and metadata on the blob. * @@ -2876,7 +2883,7 @@ public function getBlobProperties( $options )->wait(); } - + /** * Creates promise to return all properties and metadata on the blob. * @@ -2896,22 +2903,22 @@ public function getBlobPropertiesAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_HEAD; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new GetBlobPropertiesOptions(); } - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -2922,7 +2929,7 @@ public function getBlobPropertiesAsync( Resources::QP_SNAPSHOT, $options->getSnapshot() ); - + return $this->sendAsync( $method, $headers, @@ -2976,22 +2983,22 @@ public function getBlobMetadataAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_HEAD; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new GetBlobMetadataOptions(); } - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -3008,7 +3015,7 @@ public function getBlobMetadataAsync( Resources::QP_COMP, 'metadata' ); - + return $this->sendAsync( $method, $headers, @@ -3023,7 +3030,7 @@ public function getBlobMetadataAsync( return GetBlobMetadataResult::create($responseHeaders); }); } - + /** * Returns a list of active page ranges for a page blob. Active page ranges are * those that have been populated with data. @@ -3069,18 +3076,18 @@ public function listPageBlobRangesAsync( } /** - * Returns a list of page ranges that have been updated or cleared. + * Returns a list of page ranges that have been updated or cleared. * - * Returns a list of page ranges that have been updated or cleared since - * the snapshot specified by `previousSnapshotTime`. Gets all of the page - * ranges by default, or only the page ranges over a specific range of + * Returns a list of page ranges that have been updated or cleared since + * the snapshot specified by `previousSnapshotTime`. Gets all of the page + * ranges by default, or only the page ranges over a specific range of * bytes if `rangeStart` and `rangeEnd` in the `options` are specified. * * @param string $container name of the container * @param string $blob name of the blob - * @param string $previousSnapshotTime previous snapshot time + * @param string $previousSnapshotTime previous snapshot time * for comparison which - * should be prior to the + * should be prior to the * snapshot time defined * in `options` * @param Models\ListPageBlobRangesOptions $options optional parameters @@ -3105,7 +3112,7 @@ public function listPageBlobRangesDiff( /** * Creates promise to return a list of page ranges that have been updated - * or cleared. + * or cleared. * * Creates promise to return a list of page ranges that have been updated * or cleared since the snapshot specified by `previousSnapshotTime`. Gets @@ -3140,17 +3147,17 @@ public function listPageBlobRangesDiffAsync( } /** - * Creates promise to return a list of page ranges. - + * Creates promise to return a list of page ranges. + * If `previousSnapshotTime` is specified, the response will include - * only the pages that differ between the target snapshot or blob and + * only the pages that differ between the target snapshot or blob and * the previous snapshot. * * @param string $container name of the container * @param string $blob name of the blob - * @param string $previousSnapshotTime previous snapshot time + * @param string $previousSnapshotTime previous snapshot time * for comparison which - * should be prior to the + * should be prior to the * snapshot time defined * in `options` * @param Models\ListPageBlobRangesOptions $options optional parameters @@ -3168,17 +3175,17 @@ private function listPageBlobRangesAsyncImpl( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new ListPageBlobRangesOptions(); } - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() @@ -3240,7 +3247,7 @@ private function listPageBlobRangesAsyncImpl( } }, null); } - + /** * Sets system properties defined for a blob. * @@ -3283,17 +3290,17 @@ public function setBlobPropertiesAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new SetBlobPropertiesOptions(); } - + $blobContentType = $options->getContentType(); $blobContentEncoding = $options->getContentEncoding(); $blobContentLanguage = $options->getContentLanguage(); @@ -3304,12 +3311,12 @@ public function setBlobPropertiesAsync( $leaseId = $options->getLeaseId(); $sNumberAction = $options->getSequenceNumberAction(); $sNumber = $options->getSequenceNumber(); - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -3362,7 +3369,7 @@ public function setBlobPropertiesAsync( ); $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'properties'); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -3380,7 +3387,7 @@ public function setBlobPropertiesAsync( ); }, null); } - + /** * Sets metadata headers on the blob. * @@ -3429,23 +3436,23 @@ public function setBlobMetadataAsync( Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); Utilities::validateMetadata($metadata); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); $headers = $this->addMetadataHeaders($headers, $metadata); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -3456,7 +3463,7 @@ public function setBlobMetadataAsync( Resources::QP_COMP, 'metadata' ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -3536,16 +3543,16 @@ function ($result) use ($path, $resource) { stream_get_contents($content, Resources::MB_IN_BYTES_4) ); } - + $content = null; fclose($resource); - + return $result; }, null ); } - + /** * Reads or downloads a blob from the system, including its metadata and * properties. @@ -3585,17 +3592,17 @@ public function getBlobAsync( ) { Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new GetBlobOptions(); } - + $getMD5 = $options->getRangeGetContentMD5(); $headers = $this->addOptionalAccessConditionHeader( $headers, @@ -3610,7 +3617,7 @@ public function getBlobAsync( $range->getEnd() ); } - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -3628,7 +3635,7 @@ public function getBlobAsync( ); $options->setIsStreaming(true); - + return $this->sendAsync( $method, $headers, @@ -3642,7 +3649,7 @@ public function getBlobAsync( $metadata = Utilities::getMetadataArray( HttpFormatter::formatHeaders($response->getHeaders()) ); - + return GetBlobResult::create( HttpFormatter::formatHeaders($response->getHeaders()), $response->getBody(), @@ -3650,7 +3657,7 @@ public function getBlobAsync( ); }); } - + /** * Deletes a blob or blob snapshot. * @@ -3697,17 +3704,17 @@ public function deleteBlobAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_DELETE; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new DeleteBlobOptions(); } - + if (is_null($options->getSnapshot())) { $delSnapshots = $options->getDeleteSnaphotsOnly() ? 'only' : 'include'; $this->addOptionalHeader( @@ -3722,18 +3729,18 @@ public function deleteBlobAsync( $options->getSnapshot() ); } - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -3747,7 +3754,7 @@ public function deleteBlobAsync( $options ); } - + /** * Creates a snapshot of a blob. * @@ -3790,17 +3797,17 @@ public function createBlobSnapshotAsync( Validate::canCastAsString($container, 'container'); Validate::canCastAsString($blob, 'blob'); Validate::notNullOrEmpty($blob, 'blob'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($container, $blob); - + if (is_null($options)) { $options = new CreateBlobSnapshotOptions(); } - + $queryParams[Resources::QP_COMP] = 'snapshot'; $headers = $this->addOptionalAccessConditionHeader( @@ -3813,7 +3820,7 @@ public function createBlobSnapshotAsync( Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); return $this->sendAsync( @@ -3831,7 +3838,7 @@ public function createBlobSnapshotAsync( ); }, null); } - + /** * Copies a source blob to a destination blob within the same storage account. * @@ -4085,7 +4092,7 @@ public function abortCopyAsync( Validate::notNullOrEmpty($container, 'container'); Validate::notNullOrEmpty($blob, 'blob'); Validate::notNullOrEmpty($copyId, 'copyId'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); @@ -4094,11 +4101,11 @@ public function abortCopyAsync( $container, $blob ); - + if (is_null($options)) { $options = new BlobServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_TIMEOUT, @@ -4116,19 +4123,19 @@ public function abortCopyAsync( Resources::QP_COPY_ID, $copyId ); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_COPY_ACTION, 'abort' ); - + return $this->sendAsync( $method, $headers, @@ -4140,7 +4147,7 @@ public function abortCopyAsync( $options ); } - + /** * Establishes an exclusive write lock on a blob. To write to a locked * blob, a client must provide a lease ID. @@ -4227,7 +4234,7 @@ public function acquireLeaseAsync( ); }, null); } - + /** * change an existing lease * @@ -4293,7 +4300,7 @@ public function changeLeaseAsync( ); }, null); } - + /** * Renews an existing lease * @@ -4376,7 +4383,7 @@ public function releaseLease( ) { $this->releaseLeaseAsync($container, $blob, $leaseId, $options)->wait(); } - + /** * Creates promise to free the lease if it is no longer needed so that * another client may immediately acquire a lease against the blob. @@ -4408,7 +4415,7 @@ public function releaseLeaseAsync( is_null($options) ? new BlobServiceOptions() : $options ); } - + /** * Ends the lease but ensure that another client cannot acquire a new lease until * the current lease period has expired. diff --git a/src/Blob/Internal/BlobResources.php b/src/Blob/Internal/BlobResources.php index e014708..0885f77 100644 --- a/src/Blob/Internal/BlobResources.php +++ b/src/Blob/Internal/BlobResources.php @@ -41,7 +41,7 @@ class BlobResources extends Resources { // @codingStandardsIgnoreStart - const BLOB_SDK_VERSION = '1.0.0'; + const BLOB_SDK_VERSION = '1.1.0'; const STORAGE_API_LATEST_VERSION = '2016-05-31'; // Error messages diff --git a/src/Blob/Internal/IBlob.php b/src/Blob/Internal/IBlob.php index c2b6028..e497bb3 100644 --- a/src/Blob/Internal/IBlob.php +++ b/src/Blob/Internal/IBlob.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Internal; use MicrosoftAzure\Storage\Blob\Models as BlobModels; @@ -714,7 +714,7 @@ public function createBlobBlockAsync( $content, BlobModels\CreateBlobBlockOptions $options = null ); - + /** * Commits a new block of data to the end of an existing append blob. * @@ -965,18 +965,18 @@ public function listPageBlobRangesAsync( ); /** - * Returns a list of page ranges that have been updated or cleared. + * Returns a list of page ranges that have been updated or cleared. * - * Returns a list of page ranges that have been updated or cleared since - * the snapshot specified by `previousSnapshotTime`. Gets all of the page - * ranges by default, or only the page ranges over a specific range of + * Returns a list of page ranges that have been updated or cleared since + * the snapshot specified by `previousSnapshotTime`. Gets all of the page + * ranges by default, or only the page ranges over a specific range of * bytes if `rangeStart` and `rangeEnd` in the `options` are specified. * * @param string $container name of the container * @param string $blob name of the blob - * @param string $previousSnapshotTime previous snapshot time + * @param string $previousSnapshotTime previous snapshot time * for comparison which - * should be prior to the + * should be prior to the * snapshot time defined * in `options` * @param BlobModels\ListPageBlobRangesOptions $options optional parameters @@ -994,7 +994,7 @@ public function listPageBlobRangesDiff( /** * Creates promise to return a list of page ranges that have been updated - * or cleared. + * or cleared. * * Creates promise to return a list of page ranges that have been updated * or cleared since the snapshot specified by `previousSnapshotTime`. Gets @@ -1393,7 +1393,7 @@ public function acquireLeaseAsync( $leaseDuration = null, BlobModels\BlobServiceOptions $options = null ); - + /** * change an existing lease * diff --git a/src/Blob/Models/AccessCondition.php b/src/Blob/Models/AccessCondition.php index c2d0ea2..6daae08 100644 --- a/src/Blob/Models/AccessCondition.php +++ b/src/Blob/Models/AccessCondition.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -57,7 +57,7 @@ protected function __construct($headerType, $value) $this->setHeader($headerType); $this->setValue($value); } - + /** * Specifies that no access condition is set. * @@ -67,7 +67,7 @@ public static function none() { return new AccessCondition(Resources::EMPTY_STRING, null); } - + /** * Returns an access condition such that an operation will be performed only if * the resource's ETag value matches the specified ETag value. @@ -89,7 +89,7 @@ public static function ifMatch($etag) { return new AccessCondition(Resources::IF_MATCH, $etag); } - + /** * Returns an access condition such that an operation will be performed only if * the resource has been modified since the specified time. @@ -116,7 +116,7 @@ public static function ifModifiedSince(\DateTime $lastModified) $lastModified ); } - + /** * Returns an access condition such that an operation will be performed only if * the resource's ETag value does not match the specified ETag value. @@ -138,7 +138,7 @@ public static function ifNoneMatch($etag) { return new AccessCondition(Resources::IF_NONE_MATCH, $etag); } - + /** * Returns an access condition such that an operation will be performed only if * the resource has not been modified since the specified time. @@ -165,7 +165,7 @@ public static function ifNotModifiedSince(\DateTime $lastModified) $lastModified ); } - + /** * Returns an access condition such that an operation will be performed only if * the operation would cause the blob to exceed that limit or if the append @@ -187,7 +187,7 @@ public static function appendPosition($appendPosition) { return new AccessCondition(Resources::MAX_APPEND_POSITION, $appendPosition); } - + /** * Returns an access condition such that an operation will be performed only if * the operation would cause the blob to exceed that limit or if the blob size @@ -211,7 +211,7 @@ public static function maxBlobSize($maxBlobSize) { return new AccessCondition(Resources::MAX_BLOB_SIZE, $maxBlobSize); } - + /** * Returns an access condition such that an operation will be performed only if * the blob’s sequence number is less than the specified value. @@ -233,7 +233,7 @@ public static function ifSequenceNumberLessThan($sequenceNumber) { return new AccessCondition(Resources::SEQUENCE_NUMBER_LESS_THAN, $sequenceNumber); } - + /** * Returns an access condition such that an operation will be performed only if * the blob’s sequence number is equal to the specified value. @@ -255,7 +255,7 @@ public static function ifSequenceNumberEqual($sequenceNumber) { return new AccessCondition(Resources::SEQUENCE_NUMBER_EQUAL, $sequenceNumber); } - + /** * Returns an access condition such that an operation will be performed only if * the blob’s sequence number is less than or equal to the specified value. @@ -277,7 +277,7 @@ public static function ifSequenceNumberLessThanOrEqual($sequenceNumber) { return new AccessCondition(Resources::SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL, $sequenceNumber); } - + /** * Sets header type * @@ -289,10 +289,10 @@ public function setHeader($headerType) { $valid = AccessCondition::isValid($headerType); Validate::isTrue($valid, Resources::INVALID_HT_MSG); - + $this->_header = $headerType; } - + /** * Gets header type * @@ -302,7 +302,7 @@ public function getHeader() { return $this->_header; } - + /** * Sets the header value * @@ -314,7 +314,7 @@ public function setValue($value) { $this->_value = $value; } - + /** * Gets the header value * @@ -324,7 +324,7 @@ public function getValue() { return $this->_value; } - + /** * Check if the $headerType belongs to valid header types * diff --git a/src/Blob/Models/AppendBlockOptions.php b/src/Blob/Models/AppendBlockOptions.php index 087b751..6820cbb 100644 --- a/src/Blob/Models/AppendBlockOptions.php +++ b/src/Blob/Models/AppendBlockOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -39,7 +39,7 @@ class AppendBlockOptions extends BlobServiceOptions private $contentMD5; private $maxBlobSize; private $appendPosition; - + /** * Gets block contentMD5. * @@ -61,7 +61,7 @@ public function setContentMD5($contentMD5) { $this->contentMD5 = $contentMD5; } - + /** * Gets the max length in bytes allowed for the append blob to grow to. * @@ -83,7 +83,7 @@ public function setMaxBlobSize($maxBlobSize) { $this->maxBlobSize = $maxBlobSize; } - + /** * Gets append blob appendPosition. * diff --git a/src/Blob/Models/Blob.php b/src/Blob/Models/Blob.php index 56a6d35..6bfe4c2 100644 --- a/src/Blob/Models/Blob.php +++ b/src/Blob/Models/Blob.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -62,7 +62,7 @@ public function setName($name) { $this->_name = $name; } - + /** * Gets blob snapshot. * @@ -128,7 +128,7 @@ public function setMetadata(array $metadata = null) { $this->_metadata = $metadata; } - + /** * Gets blob properties. * diff --git a/src/Blob/Models/BlobAccessPolicy.php b/src/Blob/Models/BlobAccessPolicy.php index 26bb4ba..7319200 100644 --- a/src/Blob/Models/BlobAccessPolicy.php +++ b/src/Blob/Models/BlobAccessPolicy.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources; diff --git a/src/Blob/Models/BlobBlockType.php b/src/Blob/Models/BlobBlockType.php index 92f91b4..5495a3d 100644 --- a/src/Blob/Models/BlobBlockType.php +++ b/src/Blob/Models/BlobBlockType.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -39,7 +39,7 @@ class BlobBlockType const COMMITTED_TYPE = 'Committed'; const UNCOMMITTED_TYPE = 'Uncommitted'; const LATEST_TYPE = 'Latest'; - + /** * Validates the provided type. * @@ -56,7 +56,7 @@ public static function isValid($type) case self::LATEST_TYPE: case self::UNCOMMITTED_TYPE: return true; - + default: return false; } diff --git a/src/Blob/Models/BlobPrefix.php b/src/Blob/Models/BlobPrefix.php index 10a9ea2..95deea8 100644 --- a/src/Blob/Models/BlobPrefix.php +++ b/src/Blob/Models/BlobPrefix.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -37,7 +37,7 @@ class BlobPrefix { private $_name; - + /** * Gets blob name. * diff --git a/src/Blob/Models/BlobProperties.php b/src/Blob/Models/BlobProperties.php index bcc6fda..ab36ffd 100644 --- a/src/Blob/Models/BlobProperties.php +++ b/src/Blob/Models/BlobProperties.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -75,7 +75,7 @@ public static function createFromXml(array $parsed) { $result = new BlobProperties(); $clean = array_change_key_case($parsed); - + $result->setCommonBlobProperties($clean); $result->setLeaseStatus(Utilities::tryGetValue($clean, 'leasestatus')); $result->setLeaseState(Utilities::tryGetValue($clean, 'leasestate')); @@ -88,7 +88,7 @@ public static function createFromXml(array $parsed) true ) ); - + return $result; } @@ -107,7 +107,7 @@ public static function createFromHttpHeaders(array $parsed) $clean = array_change_key_case($parsed); $result->setCommonBlobProperties($clean); - + $result->setBlobType(Utilities::tryGetValue($clean, Resources::X_MS_BLOB_TYPE)); $result->setLeaseStatus(Utilities::tryGetValue($clean, Resources::X_MS_LEASE_STATUS)); $result->setLeaseState(Utilities::tryGetValue($clean, Resources::X_MS_LEASE_STATE)); @@ -192,7 +192,7 @@ public function setETag($etag) { $this->etag = $etag; } - + /** * Gets blob contentType. * @@ -214,7 +214,7 @@ public function setContentType($contentType) { $this->contentType = $contentType; } - + /** * Gets blob contentRange. * @@ -236,7 +236,7 @@ public function setContentRange($contentRange) { $this->contentRange = $contentRange; } - + /** * Gets blob contentLength. * @@ -259,7 +259,7 @@ public function setContentLength($contentLength) Validate::isInteger($contentLength, 'contentLength'); $this->contentLength = $contentLength; } - + /** * Gets blob contentEncoding. * @@ -281,7 +281,7 @@ public function setContentEncoding($contentEncoding) { $this->contentEncoding = $contentEncoding; } - + /** * Gets blob contentLanguage. * @@ -303,7 +303,7 @@ public function setContentLanguage($contentLanguage) { $this->contentLanguage = $contentLanguage; } - + /** * Gets blob contentMD5. * @@ -369,7 +369,7 @@ public function setCacheControl($cacheControl) { $this->cacheControl = $cacheControl; } - + /** * Gets blob contentDisposition. * @@ -391,7 +391,7 @@ public function setContentDisposition($contentDisposition) { $this->contentDisposition = $contentDisposition; } - + /** * Gets blob blobType. * @@ -413,7 +413,7 @@ public function setBlobType($blobType) { $this->blobType = $blobType; } - + /** * Gets blob leaseStatus. * @@ -435,7 +435,7 @@ public function setLeaseStatus($leaseStatus) { $this->leaseStatus = $leaseStatus; } - + /** * Gets blob lease state. * @@ -457,7 +457,7 @@ public function setLeaseState($leaseState) { $this->leaseState = $leaseState; } - + /** * Gets blob lease duration. * @@ -479,7 +479,7 @@ public function setLeaseDuration($leaseDuration) { $this->leaseDuration = $leaseDuration; } - + /** * Gets blob sequenceNumber. * diff --git a/src/Blob/Models/BlobServiceOptions.php b/src/Blob/Models/BlobServiceOptions.php index b3b080c..d442ec6 100644 --- a/src/Blob/Models/BlobServiceOptions.php +++ b/src/Blob/Models/BlobServiceOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Models\ServiceOptions; @@ -40,7 +40,7 @@ class BlobServiceOptions extends ServiceOptions { private $_leaseId; private $_accessConditions; - + /** * Gets lease Id for the blob * @@ -50,7 +50,7 @@ public function getLeaseId() { return $this->_leaseId; } - + /** * Sets lease Id for the blob * @@ -62,7 +62,7 @@ public function setLeaseId($leaseId) { $this->_leaseId = $leaseId; } - + /** * Gets access condition * @@ -72,7 +72,7 @@ public function getAccessConditions() { return $this->_accessConditions; } - + /** * Sets access condition * diff --git a/src/Blob/Models/BlobType.php b/src/Blob/Models/BlobType.php index ec318a1..6a539d0 100644 --- a/src/Blob/Models/BlobType.php +++ b/src/Blob/Models/BlobType.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** diff --git a/src/Blob/Models/Block.php b/src/Blob/Models/Block.php index ff8e7a8..a1eab59 100644 --- a/src/Blob/Models/Block.php +++ b/src/Blob/Models/Block.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -50,7 +50,7 @@ public function __construct($blockId = '', $type = '') $this->_blockId = $blockId; $this->_type = $type; } - + /** * Sets the blockId. * @@ -62,7 +62,7 @@ public function setBlockId($blockId) { $this->_blockId = $blockId; } - + /** * Gets the blockId. * @@ -72,7 +72,7 @@ public function getBlockId() { return $this->_blockId; } - + /** * Sets the type. * @@ -84,7 +84,7 @@ public function setType($type) { $this->_type = $type; } - + /** * Gets the type. * diff --git a/src/Blob/Models/BlockList.php b/src/Blob/Models/BlockList.php index 2a03a46..fb23b30 100644 --- a/src/Blob/Models/BlockList.php +++ b/src/Blob/Models/BlockList.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -42,7 +42,7 @@ class BlockList { private $entries; private static $xmlRootName = 'BlockList'; - + /** * Creates block list from array of blocks. * @@ -53,14 +53,14 @@ class BlockList public static function create(array $array) { $blockList = new BlockList(); - + foreach ($array as $value) { $blockList->addEntry($value->getBlockId(), $value->getType()); } - + return $blockList; } - + /** * Adds new entry to the block list entries. * @@ -79,10 +79,10 @@ public function addEntry($blockId, $type) $block = new Block(); $block->setBlockId($blockId); $block->setType($type); - + $this->entries[] = $block; } - + /** * Addds committed block entry. * @@ -94,7 +94,7 @@ public function addCommittedEntry($blockId) { $this->addEntry($blockId, BlobBlockType::COMMITTED_TYPE); } - + /** * Addds uncommitted block entry. * @@ -106,7 +106,7 @@ public function addUncommittedEntry($blockId) { $this->addEntry($blockId, BlobBlockType::UNCOMMITTED_TYPE); } - + /** * Addds latest block entry. * @@ -118,7 +118,7 @@ public function addLatestEntry($blockId) { $this->addEntry($blockId, BlobBlockType::LATEST_TYPE); } - + /** * Gets blob block entry. * @@ -133,10 +133,10 @@ public function getEntry($blockId) return $value; } } - + return null; } - + /** * Gets all blob block entries. * @@ -146,7 +146,7 @@ public function getEntries() { return $this->entries; } - + /** * Converts the BlockList object to XML representation * @@ -160,13 +160,13 @@ public function toXml(XmlSerializer $xmlSerializer) { $properties = array(XmlSerializer::ROOT_NAME => self::$xmlRootName); $array = array(); - + foreach ($this->entries as $value) { $array[] = array( $value->getType() => $value->getBlockId() ); } - + return $xmlSerializer->serialize($array, $properties); } } diff --git a/src/Blob/Models/BreakLeaseResult.php b/src/Blob/Models/BreakLeaseResult.php index 3b30464..4cb6c73 100644 --- a/src/Blob/Models/BreakLeaseResult.php +++ b/src/Blob/Models/BreakLeaseResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -40,7 +40,7 @@ class BreakLeaseResult { private $_leaseTime; - + /** * Creates BreakLeaseResult from response headers * @@ -51,14 +51,14 @@ class BreakLeaseResult public static function create($headers) { $result = new BreakLeaseResult(); - + $result->setLeaseTime( Utilities::tryGetValue($headers, Resources::X_MS_LEASE_TIME) ); - + return $result; } - + /** * Gets lease time. * @@ -68,7 +68,7 @@ public function getLeaseTime() { return $this->_leaseTime; } - + /** * Sets lease time. * diff --git a/src/Blob/Models/CommitBlobBlocksOptions.php b/src/Blob/Models/CommitBlobBlocksOptions.php index c2d22f5..6ef773f 100644 --- a/src/Blob/Models/CommitBlobBlocksOptions.php +++ b/src/Blob/Models/CommitBlobBlocksOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -65,7 +65,7 @@ public function setContentType($contentType) { $this->_contentType = $contentType; } - + /** * Gets ContentEncoding. * @@ -87,7 +87,7 @@ public function setContentEncoding($contentEncoding) { $this->_contentEncoding = $contentEncoding; } - + /** * Gets ContentLanguage. * @@ -109,7 +109,7 @@ public function setContentLanguage($contentLanguage) { $this->_contentLanguage = $contentLanguage; } - + /** * Gets ContentMD5. * @@ -131,7 +131,7 @@ public function setContentMD5($contentMD5) { $this->_contentMD5 = $contentMD5; } - + /** * Gets cache control. * @@ -141,7 +141,7 @@ public function getCacheControl() { return $this->_cacheControl; } - + /** * Sets cacheControl. * @@ -153,7 +153,7 @@ public function setCacheControl($cacheControl) { $this->_cacheControl = $cacheControl; } - + /** * Gets content disposition. * @@ -163,7 +163,7 @@ public function getContentDisposition() { return $this->_contentDisposition; } - + /** * Sets contentDisposition. * @@ -175,7 +175,7 @@ public function setContentDisposition($contentDisposition) { $this->_contentDisposition = $contentDisposition; } - + /** * Gets blob metadata. * diff --git a/src/Blob/Models/Container.php b/src/Blob/Models/Container.php index 5ae31bf..4816f50 100644 --- a/src/Blob/Models/Container.php +++ b/src/Blob/Models/Container.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -106,7 +106,7 @@ public function setMetadata(array $metadata = null) { $this->_metadata = $metadata; } - + /** * Gets container properties * @@ -116,7 +116,7 @@ public function getProperties() { return $this->_properties; } - + /** * Sets container properties * diff --git a/src/Blob/Models/ContainerACL.php b/src/Blob/Models/ContainerACL.php index 339d01c..4383abc 100644 --- a/src/Blob/Models/ContainerACL.php +++ b/src/Blob/Models/ContainerACL.php @@ -71,7 +71,7 @@ public static function create($publicAccess, array $parsed = null) $result = new ContainerACL(); $result->fromXmlArray($parsed); $result->setPublicAccess($publicAccess); - + return $result; } diff --git a/src/Blob/Models/ContainerAccessPolicy.php b/src/Blob/Models/ContainerAccessPolicy.php index fcf24ed..c181512 100644 --- a/src/Blob/Models/ContainerAccessPolicy.php +++ b/src/Blob/Models/ContainerAccessPolicy.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources; diff --git a/src/Blob/Models/ContainerProperties.php b/src/Blob/Models/ContainerProperties.php index 40a9703..b333b4b 100644 --- a/src/Blob/Models/ContainerProperties.php +++ b/src/Blob/Models/ContainerProperties.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -67,7 +67,7 @@ public function setLastModified(\DateTime $lastModified) { $this->lastModified = $lastModified; } - + /** * Gets container etag. * @@ -89,7 +89,7 @@ public function setETag($etag) { $this->etag = $etag; } - + /** * Gets blob leaseStatus. * @@ -111,7 +111,7 @@ public function setLeaseStatus($leaseStatus) { $this->leaseStatus = $leaseStatus; } - + /** * Gets blob lease state. * @@ -133,7 +133,7 @@ public function setLeaseState($leaseState) { $this->leaseState = $leaseState; } - + /** * Gets blob lease duration. * diff --git a/src/Blob/Models/CopyBlobFromURLOptions.php b/src/Blob/Models/CopyBlobFromURLOptions.php index cf0af8a..51f1d7a 100644 --- a/src/Blob/Models/CopyBlobFromURLOptions.php +++ b/src/Blob/Models/CopyBlobFromURLOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -40,7 +40,7 @@ class CopyBlobFromURLOptions extends BlobServiceOptions private $sourceAccessConditions; private $metadata; private $isIncrementalCopy; - + /** * Gets source access condition * @@ -50,7 +50,7 @@ public function getSourceAccessConditions() { return $this->sourceAccessConditions; } - + /** * Sets source access condition * @@ -67,7 +67,7 @@ public function setSourceAccessConditions($sourceAccessConditions) $this->sourceAccessConditions = [$sourceAccessConditions]; } } - + /** * Gets metadata. * diff --git a/src/Blob/Models/CopyBlobOptions.php b/src/Blob/Models/CopyBlobOptions.php index b46d70e..85fafcc 100644 --- a/src/Blob/Models/CopyBlobOptions.php +++ b/src/Blob/Models/CopyBlobOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -47,7 +47,7 @@ public function getSourceSnapshot() { return $this->sourceSnapshot; } - + /** * Sets source snapshot. * diff --git a/src/Blob/Models/CopyBlobResult.php b/src/Blob/Models/CopyBlobResult.php index 848cd16..2e15a83 100644 --- a/src/Blob/Models/CopyBlobResult.php +++ b/src/Blob/Models/CopyBlobResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -43,7 +43,7 @@ class CopyBlobResult private $_lastModified; private $_copyId; private $_copyStatus; - + /** * Creates CopyBlobResult object from the response of the copy blob request. * @@ -81,10 +81,10 @@ public static function create(array $headers) ); $result->setLastModified(Utilities::rfc1123ToDateTime($lastModified)); } - + return $result; } - + /** * Gets copy Id * @@ -94,7 +94,7 @@ public function getCopyId() { return $this->_copyId; } - + /** * Sets copy Id * @@ -108,7 +108,7 @@ protected function setCopyId($copyId) { $this->_copyId = $copyId; } - + /** * Gets copy status * @@ -118,7 +118,7 @@ public function getCopyStatus() { return $this->_copyStatus; } - + /** * Sets copy status * @@ -132,7 +132,7 @@ protected function setCopyStatus($copystatus) { $this->_copyStatus = $copystatus; } - + /** * Gets ETag. * @@ -154,7 +154,7 @@ protected function setETag($etag) { $this->_etag = $etag; } - + /** * Gets blob lastModified. * diff --git a/src/Blob/Models/CopyState.php b/src/Blob/Models/CopyState.php index 52ace6a..dd140c7 100644 --- a/src/Blob/Models/CopyState.php +++ b/src/Blob/Models/CopyState.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -46,7 +46,7 @@ class CopyState private $_source; private $_bytesCopied; private $_totalBytes; - + /** * Creates CopyState object from $parsed response in array representation of XML elements * @@ -60,7 +60,7 @@ public static function createFromXml(array $parsed) { $result = new CopyState(); $clean = array_change_key_case($parsed); - + $copyCompletionTime = Utilities::tryGetValue($clean, 'copycompletiontime'); if (!is_null($copyCompletionTime)) { $copyCompletionTime = Utilities::rfc1123ToDateTime($copyCompletionTime); @@ -71,7 +71,7 @@ public static function createFromXml(array $parsed) $result->setStatus(Utilities::tryGetValue($clean, 'copystatus')); $result->setStatusDescription(Utilities::tryGetValue($clean, 'copystatusdescription')); $result->setSource(Utilities::tryGetValue($clean, 'copysource')); - + $copyProgress = Utilities::tryGetValue($clean, 'copyprogress'); if (strpos($copyProgress, '/') !== false) { @@ -82,10 +82,10 @@ public static function createFromXml(array $parsed) $result->setBytesCopied($bytesCopied); $result->setTotalBytes($totalBytes); } - + return $result; } - + /** * Creates CopyState object from $parsed response in array representation of http headers * @@ -99,7 +99,7 @@ public static function createFromHttpHeaders(array $parsed) { $result = new CopyState(); $clean = array_change_key_case($parsed); - + $copyCompletionTime = Utilities::tryGetValue($clean, Resources::X_MS_COPY_COMPLETION_TIME); if (!is_null($copyCompletionTime)) { $copyCompletionTime = Utilities::rfc1123ToDateTime($copyCompletionTime); @@ -110,7 +110,7 @@ public static function createFromHttpHeaders(array $parsed) $result->setStatus(Utilities::tryGetValue($clean, Resources::X_MS_COPY_STATUS)); $result->setStatusDescription(Utilities::tryGetValue($clean, Resources::X_MS_COPY_STATUS_DESCRIPTION)); $result->setSource(Utilities::tryGetValue($clean, Resources::X_MS_COPY_SOURCE)); - + $copyProgress = Utilities::tryGetValue($clean, Resources::X_MS_COPY_PROGRESS); if (strpos($copyProgress, '/') !== false) { $parts = explode('/', $copyProgress); @@ -120,10 +120,10 @@ public static function createFromHttpHeaders(array $parsed) $result->setBytesCopied($bytesCopied); $result->setTotalBytes($totalBytes); } - + return $result; } - + /** * Gets copy Id * @@ -133,7 +133,7 @@ public function getCopyId() { return $this->_copyId; } - + /** * Sets copy Id * @@ -147,7 +147,7 @@ protected function setCopyId($copyId) { $this->_copyId = $copyId; } - + /** * Gets copy completion time * @@ -157,7 +157,7 @@ public function getCompletionTime() { return $this->_completionTime; } - + /** * Sets copy completion time * @@ -171,7 +171,7 @@ protected function setCompletionTime($completionTime) { $this->_completionTime = $completionTime; } - + /** * Gets copy status * @@ -181,7 +181,7 @@ public function getStatus() { return $this->_status; } - + /** * Sets copy status * @@ -195,7 +195,7 @@ protected function setStatus($status) { $this->_status = $status; } - + /** * Gets copy status description * @@ -205,7 +205,7 @@ public function getStatusDescription() { return $this->_statusDescription; } - + /** * Sets copy status description * @@ -219,7 +219,7 @@ protected function setStatusDescription($statusDescription) { $this->_statusDescription = $statusDescription; } - + /** * Gets copy source * @@ -229,7 +229,7 @@ public function getSource() { return $this->_source; } - + /** * Sets copy source * @@ -243,7 +243,7 @@ protected function setSource($source) { $this->_source = $source; } - + /** * Gets bytes copied * @@ -253,7 +253,7 @@ public function getBytesCopied() { return $this->_bytesCopied; } - + /** * Sets bytes copied * @@ -267,7 +267,7 @@ protected function setBytesCopied($bytesCopied) { $this->_bytesCopied = $bytesCopied; } - + /** * Gets total bytes to be copied * @@ -277,7 +277,7 @@ public function getTotalBytes() { return $this->_bytesCopied; } - + /** * Sets total bytes to be copied * diff --git a/src/Blob/Models/CreateBlobBlockOptions.php b/src/Blob/Models/CreateBlobBlockOptions.php index d4bbe85..7ee56d4 100644 --- a/src/Blob/Models/CreateBlobBlockOptions.php +++ b/src/Blob/Models/CreateBlobBlockOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -38,7 +38,7 @@ class CreateBlobBlockOptions extends BlobServiceOptions { private $_contentMD5; private $_numberOfConcurrency; - + /** * Gets blob contentMD5. * diff --git a/src/Blob/Models/CreateBlobOptions.php b/src/Blob/Models/CreateBlobOptions.php index 6089b3c..f359f46 100644 --- a/src/Blob/Models/CreateBlobOptions.php +++ b/src/Blob/Models/CreateBlobOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -47,7 +47,7 @@ class CreateBlobOptions extends BlobServiceOptions private $_metadata; private $_sequenceNumber; private $_numberOfConcurrency; - + /** * Gets blob contentType. * @@ -69,7 +69,7 @@ public function setContentType($contentType) { $this->_contentType = $contentType; } - + /** * Gets contentEncoding. * @@ -91,7 +91,7 @@ public function setContentEncoding($contentEncoding) { $this->_contentEncoding = $contentEncoding; } - + /** * Gets contentLanguage. * @@ -113,7 +113,7 @@ public function setContentLanguage($contentLanguage) { $this->_contentLanguage = $contentLanguage; } - + /** * Gets contentMD5. * @@ -135,7 +135,7 @@ public function setContentMD5($contentMD5) { $this->_contentMD5 = $contentMD5; } - + /** * Gets cacheControl. * @@ -145,7 +145,7 @@ public function getCacheControl() { return $this->_cacheControl; } - + /** * Sets cacheControl. * @@ -157,7 +157,7 @@ public function setCacheControl($cacheControl) { $this->_cacheControl = $cacheControl; } - + /** * Gets content disposition. * @@ -167,7 +167,7 @@ public function getContentDisposition() { return $this->_contentDisposition; } - + /** * Sets content disposition. * @@ -179,7 +179,7 @@ public function setContentDisposition($contentDisposition) { $this->_contentDisposition = $contentDisposition; } - + /** * Gets blob metadata. * @@ -201,7 +201,7 @@ public function setMetadata(array $metadata) { $this->_metadata = $metadata; } - + /** * Gets blob sequenceNumber. * diff --git a/src/Blob/Models/CreateBlobPagesOptions.php b/src/Blob/Models/CreateBlobPagesOptions.php index 6ee39f3..97e1bc1 100644 --- a/src/Blob/Models/CreateBlobPagesOptions.php +++ b/src/Blob/Models/CreateBlobPagesOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -37,7 +37,7 @@ class CreateBlobPagesOptions extends BlobServiceOptions { private $_contentMD5; - + /** * Gets blob contentMD5. * diff --git a/src/Blob/Models/CreateBlobPagesResult.php b/src/Blob/Models/CreateBlobPagesResult.php index 61c7c40..5a6caf5 100644 --- a/src/Blob/Models/CreateBlobPagesResult.php +++ b/src/Blob/Models/CreateBlobPagesResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -60,7 +60,7 @@ public static function create(array $headers) { $result = new CreateBlobPagesResult(); $clean = array_change_key_case($headers); - + $date = $clean[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); $result->setETag($clean[Resources::ETAG]); @@ -88,10 +88,10 @@ public static function create(array $headers) ) ) ); - + return $result; } - + /** * Gets blob lastModified. * @@ -137,7 +137,7 @@ protected function setETag($etag) Validate::canCastAsString($etag, 'etag'); $this->etag = $etag; } - + /** * Gets blob contentMD5. * diff --git a/src/Blob/Models/CreateBlobSnapshotOptions.php b/src/Blob/Models/CreateBlobSnapshotOptions.php index e5f4230..6b89184 100644 --- a/src/Blob/Models/CreateBlobSnapshotOptions.php +++ b/src/Blob/Models/CreateBlobSnapshotOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -37,7 +37,7 @@ class CreateBlobSnapshotOptions extends BlobServiceOptions { private $_metadata; - + /** * Gets metadata. * diff --git a/src/Blob/Models/CreateBlobSnapshotResult.php b/src/Blob/Models/CreateBlobSnapshotResult.php index 89c611b..b94c0ed 100644 --- a/src/Blob/Models/CreateBlobSnapshotResult.php +++ b/src/Blob/Models/CreateBlobSnapshotResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -42,7 +42,7 @@ class CreateBlobSnapshotResult private $_snapshot; private $_etag; private $_lastModified; - + /** * Creates CreateBlobSnapshotResult object from the response of the * create Blob snapshot request. @@ -57,20 +57,20 @@ public static function create(array $headers) { $result = new CreateBlobSnapshotResult(); $headerWithLowerCaseKey = array_change_key_case($headers); - + $result->setETag($headerWithLowerCaseKey[Resources::ETAG]); - + $result->setLastModified( Utilities::rfc1123ToDateTime( $headerWithLowerCaseKey[Resources::LAST_MODIFIED] ) ); - + $result->setSnapshot($headerWithLowerCaseKey[Resources::X_MS_SNAPSHOT]); - + return $result; } - + /** * Gets snapshot. * @@ -80,7 +80,7 @@ public function getSnapshot() { return $this->_snapshot; } - + /** * Sets snapshot. * @@ -92,7 +92,7 @@ protected function setSnapshot($snapshot) { $this->_snapshot = $snapshot; } - + /** * Gets ETag. * @@ -114,7 +114,7 @@ protected function setETag($etag) { $this->_etag = $etag; } - + /** * Gets blob lastModified. * diff --git a/src/Blob/Models/CreateBlockBlobOptions.php b/src/Blob/Models/CreateBlockBlobOptions.php index 3b3946f..105cd8c 100644 --- a/src/Blob/Models/CreateBlockBlobOptions.php +++ b/src/Blob/Models/CreateBlockBlobOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Models\TransactionalMD5Trait; diff --git a/src/Blob/Models/CreateContainerOptions.php b/src/Blob/Models/CreateContainerOptions.php index a825338..5658155 100644 --- a/src/Blob/Models/CreateContainerOptions.php +++ b/src/Blob/Models/CreateContainerOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -40,7 +40,7 @@ class CreateContainerOptions extends BlobServiceOptions { private $_publicAccess; private $_metadata; - + /** * Gets container public access. * @@ -50,7 +50,7 @@ public function getPublicAccess() { return $this->_publicAccess; } - + /** * Specifies whether data in the container may be accessed publicly and the level * of access. Possible values include: @@ -73,7 +73,7 @@ public function setPublicAccess($publicAccess) Validate::canCastAsString($publicAccess, 'publicAccess'); $this->_publicAccess = $publicAccess; } - + /** * Gets user defined metadata. * @@ -83,7 +83,7 @@ public function getMetadata() { return $this->_metadata; } - + /** * Sets user defined metadata. This metadata should be added without the header * prefix (x-ms-meta-*). @@ -96,7 +96,7 @@ public function setMetadata(array $metadata) { $this->_metadata = $metadata; } - + /** * Adds new metadata element. This element should be added without the header * prefix (x-ms-meta-*). diff --git a/src/Blob/Models/CreatePageBlobFromContentOptions.php b/src/Blob/Models/CreatePageBlobFromContentOptions.php index 2f12987..5fda97b 100644 --- a/src/Blob/Models/CreatePageBlobFromContentOptions.php +++ b/src/Blob/Models/CreatePageBlobFromContentOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Models\TransactionalMD5Trait; diff --git a/src/Blob/Models/DeleteBlobOptions.php b/src/Blob/Models/DeleteBlobOptions.php index 2bbed7f..52c2091 100644 --- a/src/Blob/Models/DeleteBlobOptions.php +++ b/src/Blob/Models/DeleteBlobOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -40,7 +40,7 @@ class DeleteBlobOptions extends BlobServiceOptions { private $_snapshot; private $_deleteSnaphotsOnly; - + /** * Gets blob snapshot. * @@ -62,7 +62,7 @@ public function setSnapshot($snapshot) { $this->_snapshot = $snapshot; } - + /** * Gets blob deleteSnaphotsOnly. * diff --git a/src/Blob/Models/GetBlobMetadataOptions.php b/src/Blob/Models/GetBlobMetadataOptions.php index 2b7695a..7cba28f 100644 --- a/src/Blob/Models/GetBlobMetadataOptions.php +++ b/src/Blob/Models/GetBlobMetadataOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -37,7 +37,7 @@ class GetBlobMetadataOptions extends BlobServiceOptions { private $_snapshot; - + /** * Gets blob snapshot. * diff --git a/src/Blob/Models/GetBlobMetadataResult.php b/src/Blob/Models/GetBlobMetadataResult.php index f9c1bcd..637f1db 100644 --- a/src/Blob/Models/GetBlobMetadataResult.php +++ b/src/Blob/Models/GetBlobMetadataResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; diff --git a/src/Blob/Models/GetBlobOptions.php b/src/Blob/Models/GetBlobOptions.php index 20ee494..99f06a2 100644 --- a/src/Blob/Models/GetBlobOptions.php +++ b/src/Blob/Models/GetBlobOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -42,7 +42,7 @@ class GetBlobOptions extends BlobServiceOptions private $snapshot; private $range; private $rangeGetContentMD5; - + /** * Gets blob snapshot. * diff --git a/src/Blob/Models/GetBlobPropertiesOptions.php b/src/Blob/Models/GetBlobPropertiesOptions.php index 833939a..2f4c24b 100644 --- a/src/Blob/Models/GetBlobPropertiesOptions.php +++ b/src/Blob/Models/GetBlobPropertiesOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -37,7 +37,7 @@ class GetBlobPropertiesOptions extends BlobServiceOptions { private $_snapshot; - + /** * Gets blob snapshot. * diff --git a/src/Blob/Models/GetBlobPropertiesResult.php b/src/Blob/Models/GetBlobPropertiesResult.php index c5e4c04..18b9992 100644 --- a/src/Blob/Models/GetBlobPropertiesResult.php +++ b/src/Blob/Models/GetBlobPropertiesResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; @@ -41,7 +41,7 @@ class GetBlobPropertiesResult use MetadataTrait; private $_properties; - + /** * Gets blob properties. * @@ -78,7 +78,7 @@ public static function create(array $headers) $result = static::createMetadataResult($headers); $result->setProperties(BlobProperties::createFromHttpHeaders($headers)); - + return $result; } } diff --git a/src/Blob/Models/GetBlobResult.php b/src/Blob/Models/GetBlobResult.php index b12cb63..13d63ea 100644 --- a/src/Blob/Models/GetBlobResult.php +++ b/src/Blob/Models/GetBlobResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use Psr\Http\Message\StreamInterface; @@ -41,7 +41,7 @@ class GetBlobResult private $properties; private $metadata; private $contentStream; - + /** * Creates GetBlobResult from getBlob call. * @@ -62,10 +62,10 @@ public static function create( $result->setContentStream($body->detach()); $result->setProperties(BlobProperties::createFromHttpHeaders($headers)); $result->setMetadata(is_null($metadata) ? array() : $metadata); - + return $result; } - + /** * Gets blob metadata. * @@ -87,7 +87,7 @@ protected function setMetadata(array $metadata) { $this->metadata = $metadata; } - + /** * Gets blob properties. * @@ -109,7 +109,7 @@ protected function setProperties(BlobProperties $properties) { $this->properties = $properties; } - + /** * Gets blob contentStream. * diff --git a/src/Blob/Models/GetContainerACLResult.php b/src/Blob/Models/GetContainerACLResult.php index 1876b6d..412c369 100644 --- a/src/Blob/Models/GetContainerACLResult.php +++ b/src/Blob/Models/GetContainerACLResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -40,7 +40,7 @@ class GetContainerACLResult private $lastModified; private $etag; - + /** * Parses the given array into signed identifiers * @@ -65,10 +65,10 @@ public static function create( $result->setLastModified($lastModified); $acl = ContainerACL::create($publicAccess, $parsed); $result->setContainerAcl($acl); - + return $result; } - + /** * Gets container ACL * @@ -78,7 +78,7 @@ public function getContainerAcl() { return $this->containerACL; } - + /** * Sets container ACL * @@ -90,7 +90,7 @@ protected function setContainerAcl(ContainerACL $containerACL) { $this->containerACL = $containerACL; } - + /** * Gets container lastModified. * diff --git a/src/Blob/Models/GetContainerPropertiesResult.php b/src/Blob/Models/GetContainerPropertiesResult.php index dea7855..4d8c410 100644 --- a/src/Blob/Models/GetContainerPropertiesResult.php +++ b/src/Blob/Models/GetContainerPropertiesResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; @@ -47,7 +47,7 @@ class GetContainerPropertiesResult private $leaseState; private $leaseDuration; private $publicAccess; - + /** * Gets blob leaseStatus. * @@ -69,7 +69,7 @@ public function setLeaseStatus($leaseStatus) { $this->leaseStatus = $leaseStatus; } - + /** * Gets blob lease state. * @@ -91,7 +91,7 @@ public function setLeaseState($leaseState) { $this->leaseState = $leaseState; } - + /** * Gets blob lease duration. * diff --git a/src/Blob/Models/LeaseMode.php b/src/Blob/Models/LeaseMode.php index 9f3f631..03bc72f 100644 --- a/src/Blob/Models/LeaseMode.php +++ b/src/Blob/Models/LeaseMode.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** diff --git a/src/Blob/Models/LeaseResult.php b/src/Blob/Models/LeaseResult.php index 271909f..f29121d 100644 --- a/src/Blob/Models/LeaseResult.php +++ b/src/Blob/Models/LeaseResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -40,7 +40,7 @@ class LeaseResult { private $leaseId; - + /** * Creates LeaseResult from response headers * @@ -53,14 +53,14 @@ class LeaseResult public static function create(array $headers) { $result = new LeaseResult(); - + $result->setLeaseId( Utilities::tryGetValue($headers, Resources::X_MS_LEASE_ID) ); - + return $result; } - + /** * Gets lease Id for the blob * @@ -70,7 +70,7 @@ public function getLeaseId() { return $this->leaseId; } - + /** * Sets lease Id for the blob * diff --git a/src/Blob/Models/ListBlobBlocksOptions.php b/src/Blob/Models/ListBlobBlocksOptions.php index 0b2ca77..043b8aa 100644 --- a/src/Blob/Models/ListBlobBlocksOptions.php +++ b/src/Blob/Models/ListBlobBlocksOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -42,7 +42,7 @@ class ListBlobBlocksOptions extends BlobServiceOptions private $_includeUncommittedBlobs; private $_includeCommittedBlobs; private static $_listType; - + /** * Constructs the static variable $listType. */ @@ -53,11 +53,11 @@ public function __construct() self::$_listType[true][false] = 'uncommitted'; self::$_listType[false][true] = 'committed'; self::$_listType[false][false] = 'all'; - + $this->_includeUncommittedBlobs = false; $this->_includeCommittedBlobs = false; } - + /** * Gets blob snapshot. * @@ -79,7 +79,7 @@ public function setSnapshot($snapshot) { $this->_snapshot = $snapshot; } - + /** * Sets the include uncommittedBlobs flag. * @@ -92,7 +92,7 @@ public function setIncludeUncommittedBlobs($includeUncommittedBlobs) Validate::isBoolean($includeUncommittedBlobs); $this->_includeUncommittedBlobs = $includeUncommittedBlobs; } - + /** * Indicates if uncommittedBlobs is included or not. * @@ -102,7 +102,7 @@ public function getIncludeUncommittedBlobs() { return $this->_includeUncommittedBlobs; } - + /** * Sets the include committedBlobs flag. * @@ -115,7 +115,7 @@ public function setIncludeCommittedBlobs($includeCommittedBlobs) Validate::isBoolean($includeCommittedBlobs); $this->_includeCommittedBlobs = $includeCommittedBlobs; } - + /** * Indicates if committedBlobs is included or not. * @@ -125,7 +125,7 @@ public function getIncludeCommittedBlobs() { return $this->_includeCommittedBlobs; } - + /** * Gets block list type. * @@ -135,7 +135,7 @@ public function getBlockListType() { $includeUncommitted = $this->_includeUncommittedBlobs; $includeCommitted = $this->_includeCommittedBlobs; - + return self::$_listType[$includeUncommitted][$includeCommitted]; } } diff --git a/src/Blob/Models/ListBlobBlocksResult.php b/src/Blob/Models/ListBlobBlocksResult.php index c8f4bf2..c879d97 100644 --- a/src/Blob/Models/ListBlobBlocksResult.php +++ b/src/Blob/Models/ListBlobBlocksResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -46,7 +46,7 @@ class ListBlobBlocksResult private $contentLength; private $committedBlocks; private $uncommittedBlocks; - + /** * Gets block entries from parsed response * @@ -58,25 +58,25 @@ class ListBlobBlocksResult private static function getEntries(array $parsed, $type) { $entries = array(); - + if (is_array($parsed)) { $rawEntries = array(); - + if (array_key_exists($type, $parsed) && is_array($parsed[$type]) && !empty($parsed[$type]) ) { $rawEntries = Utilities::getArray($parsed[$type]['Block']); } - + foreach ($rawEntries as $value) { $entries[$value['Name']] = $value['Size']; } } - + return $entries; } - + /** * Creates ListBlobBlocksResult from given response headers and parsed body * @@ -91,7 +91,7 @@ public static function create(array $headers, array $parsed) { $result = new ListBlobBlocksResult(); $clean = array_change_key_case($headers); - + $result->setETag(Utilities::tryGetValue($clean, Resources::ETAG)); $date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED); if (!is_null($date)) { @@ -106,16 +106,16 @@ public static function create(array $headers, array $parsed) $result->setContentType( Utilities::tryGetValue($clean, Resources::CONTENT_TYPE) ); - + $result->uncommittedBlocks = self::getEntries( $parsed, 'UncommittedBlocks' ); $result->committedBlocks = self::getEntries($parsed, 'CommittedBlocks'); - + return $result; } - + /** * Gets blob lastModified. * @@ -160,7 +160,7 @@ protected function setETag($etag) { $this->etag = $etag; } - + /** * Gets blob contentType. * @@ -182,7 +182,7 @@ protected function setContentType($contentType) { $this->contentType = $contentType; } - + /** * Gets blob contentLength. * @@ -205,7 +205,7 @@ protected function setContentLength($contentLength) Validate::isInteger($contentLength, 'contentLength'); $this->contentLength = $contentLength; } - + /** * Gets uncommitted blocks * @@ -215,7 +215,7 @@ public function getUncommittedBlocks() { return $this->uncommittedBlocks; } - + /** * Sets uncommitted blocks * @@ -227,7 +227,7 @@ protected function setUncommittedBlocks(array $uncommittedBlocks) { $this->uncommittedBlocks = $uncommittedBlocks; } - + /** * Gets committed blocks * @@ -237,7 +237,7 @@ public function getCommittedBlocks() { return $this->committedBlocks; } - + /** * Sets committed blocks * diff --git a/src/Blob/Models/ListBlobsOptions.php b/src/Blob/Models/ListBlobsOptions.php index 8a54cfd..1ef4763 100644 --- a/src/Blob/Models/ListBlobsOptions.php +++ b/src/Blob/Models/ListBlobsOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -71,7 +71,7 @@ public function setPrefix($prefix) Validate::canCastAsString($prefix, 'prefix'); $this->_prefix = $prefix; } - + /** * Gets delimiter. * @@ -140,7 +140,7 @@ public function setIncludeMetadata($includeMetadata) Validate::isBoolean($includeMetadata); $this->_includeMetadata = $includeMetadata; } - + /** * Indicates if snapshots is included or not. * @@ -163,7 +163,7 @@ public function setIncludeSnapshots($includeSnapshots) Validate::isBoolean($includeSnapshots); $this->_includeSnapshots = $includeSnapshots; } - + /** * Indicates if uncommittedBlobs is included or not. * @@ -186,7 +186,7 @@ public function setIncludeUncommittedBlobs($includeUncommittedBlobs) Validate::isBoolean($includeUncommittedBlobs); $this->_includeUncommittedBlobs = $includeUncommittedBlobs; } - + /** * Indicates if copy is included or not. * diff --git a/src/Blob/Models/ListBlobsResult.php b/src/Blob/Models/ListBlobsResult.php index d809d6e..8de0c41 100644 --- a/src/Blob/Models/ListBlobsResult.php +++ b/src/Blob/Models/ListBlobsResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -108,13 +108,13 @@ public static function create(array $parsed, $location = '') $blobPrefixes = array(); $rawBlobs = array(); $rawBlobPrefixes = array(); - + if (is_array($parsed['Blobs']) && array_key_exists('Blob', $parsed['Blobs']) ) { $rawBlobs = Utilities::getArray($parsed['Blobs']['Blob']); } - + foreach ($rawBlobs as $value) { $blob = new Blob(); $blob->setName($value['Name']); @@ -128,29 +128,29 @@ public static function create(array $parsed, $location = '') $blob->setMetadata( Utilities::tryGetValue($value, Resources::QP_METADATA, array()) ); - + $blobs[] = $blob; } - + if (is_array($parsed['Blobs']) && array_key_exists('BlobPrefix', $parsed['Blobs']) ) { $rawBlobPrefixes = Utilities::getArray($parsed['Blobs']['BlobPrefix']); } - + foreach ($rawBlobPrefixes as $value) { $blobPrefix = new BlobPrefix(); $blobPrefix->setName($value['Name']); - + $blobPrefixes[] = $blobPrefix; } $result->setBlobs($blobs); $result->setBlobPrefixes($blobPrefixes); - + return $result; } - + /** * Gets blobs. * @@ -160,7 +160,7 @@ public function getBlobs() { return $this->blobs; } - + /** * Sets blobs. * @@ -175,7 +175,7 @@ protected function setBlobs(array $blobs) $this->blobs[] = clone $blob; } } - + /** * Gets blobPrefixes. * @@ -185,7 +185,7 @@ public function getBlobPrefixes() { return $this->blobPrefixes; } - + /** * Sets blobPrefixes. * @@ -222,7 +222,7 @@ protected function setPrefix($prefix) { $this->prefix = $prefix; } - + /** * Gets prefix. * diff --git a/src/Blob/Models/ListContainersOptions.php b/src/Blob/Models/ListContainersOptions.php index 5ef7c94..aeb7195 100644 --- a/src/Blob/Models/ListContainersOptions.php +++ b/src/Blob/Models/ListContainersOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\MarkerContinuationTokenTrait; diff --git a/src/Blob/Models/ListContainersResult.php b/src/Blob/Models/ListContainersResult.php index abd5877..4064d62 100644 --- a/src/Blob/Models/ListContainersResult.php +++ b/src/Blob/Models/ListContainersResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -91,19 +91,19 @@ public static function create(array $parsedResponse, $location = '') ) ); } - + $result->setMaxResults(Utilities::tryGetValue( $parsedResponse, Resources::QP_MAX_RESULTS )); $containers = array(); $rawContainer = array(); - + if (!empty($parsedResponse['Containers'])) { $containersArray = $parsedResponse['Containers']['Container']; $rawContainer = Utilities::getArray($containersArray); } - + foreach ($rawContainer as $value) { $container = new Container(); $container->setName($value['Name']); @@ -116,7 +116,7 @@ public static function create(array $parsedResponse, $location = '') $date = Utilities::rfc1123ToDateTime($date); $properties->setLastModified($date); $properties->setETag($value['Properties']['Etag']); - + if (array_key_exists('LeaseStatus', $value['Properties'])) { $properties->setLeaseStatus($value['Properties']['LeaseStatus']); } @@ -150,7 +150,7 @@ protected function setContainers(array $containers) $this->containers[] = clone $container; } } - + /** * Gets containers. * diff --git a/src/Blob/Models/ListPageBlobRangesDiffResult.php b/src/Blob/Models/ListPageBlobRangesDiffResult.php index 1575a5e..9dddd58 100644 --- a/src/Blob/Models/ListPageBlobRangesDiffResult.php +++ b/src/Blob/Models/ListPageBlobRangesDiffResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -54,7 +54,7 @@ public static function create(array $headers, array $parsed = null) { $result = new ListPageBlobRangesDiffResult(); $headers = array_change_key_case($headers); - + $date = $headers[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); $blobLength = intval($headers[Resources::X_MS_BLOB_CONTENT_LENGTH]); @@ -73,7 +73,7 @@ public static function create(array $headers, array $parsed = null) if (!empty($parsed[strtolower(Resources::XTAG_PAGE_RANGE)])) { $rawRanges = Utilities::getArray($parsed[strtolower(Resources::XTAG_PAGE_RANGE)]); } - + $pageRanges = array(); foreach ($rawRanges as $value) { $pageRanges[] = new RangeDiff( diff --git a/src/Blob/Models/ListPageBlobRangesOptions.php b/src/Blob/Models/ListPageBlobRangesOptions.php index 155cbe4..17279b1 100644 --- a/src/Blob/Models/ListPageBlobRangesOptions.php +++ b/src/Blob/Models/ListPageBlobRangesOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -43,7 +43,7 @@ class ListPageBlobRangesOptions extends BlobServiceOptions private $range; private $_rangeStart; private $_rangeEnd; - + /** * Gets blob snapshot. * diff --git a/src/Blob/Models/ListPageBlobRangesResult.php b/src/Blob/Models/ListPageBlobRangesResult.php index 262b4c7..7c40d49 100644 --- a/src/Blob/Models/ListPageBlobRangesResult.php +++ b/src/Blob/Models/ListPageBlobRangesResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -45,7 +45,7 @@ class ListPageBlobRangesResult private $_etag; private $_contentLength; private $_pageRanges; - + /** * Creates BlobProperties object from $parsed response in array representation * @@ -60,17 +60,17 @@ public static function create(array $headers, array $parsed = null) { $result = new ListPageBlobRangesResult(); $headers = array_change_key_case($headers); - + $date = $headers[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); $blobLength = intval($headers[Resources::X_MS_BLOB_CONTENT_LENGTH]); $rawRanges = array(); - + if (!empty($parsed[Resources::XTAG_PAGE_RANGE])) { $parsed = array_change_key_case($parsed); $rawRanges = Utilities::getArray($parsed[strtolower(RESOURCES::XTAG_PAGE_RANGE)]); } - + $pageRanges = array(); foreach ($rawRanges as $value) { $pageRanges[] = new Range( @@ -82,10 +82,10 @@ public static function create(array $headers, array $parsed = null) $result->setContentLength($blobLength); $result->setETag($headers[Resources::ETAG]); $result->setLastModified($date); - + return $result; } - + /** * Gets blob lastModified. * @@ -131,7 +131,7 @@ protected function setETag($etag) Validate::canCastAsString($etag, 'etag'); $this->_etag = $etag; } - + /** * Gets blob contentLength. * @@ -154,7 +154,7 @@ protected function setContentLength($contentLength) Validate::isInteger($contentLength, 'contentLength'); $this->_contentLength = $contentLength; } - + /** * Gets page ranges * @@ -164,7 +164,7 @@ public function getRanges() { return $this->_pageRanges; } - + /** * Sets page ranges * diff --git a/src/Blob/Models/PageWriteOption.php b/src/Blob/Models/PageWriteOption.php index cadc9d0..4052443 100644 --- a/src/Blob/Models/PageWriteOption.php +++ b/src/Blob/Models/PageWriteOption.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** diff --git a/src/Blob/Models/PublicAccessType.php b/src/Blob/Models/PublicAccessType.php index 81edb62..40b5991 100644 --- a/src/Blob/Models/PublicAccessType.php +++ b/src/Blob/Models/PublicAccessType.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -41,7 +41,7 @@ class PublicAccessType const NONE = null; const BLOBS_ONLY = 'blob'; const CONTAINER_AND_BLOBS = 'container'; - + /** * Validates the public access. * diff --git a/src/Blob/Models/PutBlockResult.php b/src/Blob/Models/PutBlockResult.php index 33a4b9d..80a2921 100644 --- a/src/Blob/Models/PutBlockResult.php +++ b/src/Blob/Models/PutBlockResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -68,7 +68,7 @@ public static function create(array $headers) true ) ); - + return $result; } diff --git a/src/Blob/Models/SetBlobMetadataResult.php b/src/Blob/Models/SetBlobMetadataResult.php index 532c8b0..478899f 100644 --- a/src/Blob/Models/SetBlobMetadataResult.php +++ b/src/Blob/Models/SetBlobMetadataResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -80,7 +80,7 @@ public static function create(array $headers) return $result; } - + /** * Gets blob lastModified. * diff --git a/src/Blob/Models/SetBlobPropertiesOptions.php b/src/Blob/Models/SetBlobPropertiesOptions.php index 70781b2..0b45c00 100644 --- a/src/Blob/Models/SetBlobPropertiesOptions.php +++ b/src/Blob/Models/SetBlobPropertiesOptions.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; /** @@ -38,7 +38,7 @@ class SetBlobPropertiesOptions extends BlobServiceOptions { private $_blobProperties; private $_sequenceNumberAction; - + /** * Creates a new SetBlobPropertiesOptions with a specified BlobProperties * instance. @@ -51,7 +51,7 @@ public function __construct(BlobProperties $blobProperties = null) $this->_blobProperties = is_null($blobProperties) ? new BlobProperties() : clone $blobProperties; } - + /** * Gets blob sequenceNumber. * @@ -73,7 +73,7 @@ public function setSequenceNumber($sequenceNumber) { $this->_blobProperties->setSequenceNumber($sequenceNumber); } - + /** * Gets lease Id for the blob * @@ -83,7 +83,7 @@ public function getSequenceNumberAction() { return $this->_sequenceNumberAction; } - + /** * Sets lease Id for the blob * @@ -95,7 +95,7 @@ public function setSequenceNumberAction($sequenceNumberAction) { $this->_sequenceNumberAction = $sequenceNumberAction; } - + /** * Gets blob contentLength. * @@ -117,7 +117,7 @@ public function setContentLength($contentLength) { $this->_blobProperties->setContentLength($contentLength); } - + /** * Gets ContentType. * @@ -139,7 +139,7 @@ public function setContentType($contentType) { $this->_blobProperties->setContentType($contentType); } - + /** * Gets ContentEncoding. * @@ -161,7 +161,7 @@ public function setContentEncoding($contentEncoding) { $this->_blobProperties->setContentEncoding($contentEncoding); } - + /** * Gets ContentLanguage. * @@ -183,7 +183,7 @@ public function setContentLanguage($contentLanguage) { $this->_blobProperties->setContentLanguage($contentLanguage); } - + /** * Gets ContentMD5. * @@ -205,7 +205,7 @@ public function setContentMD5($contentMD5) { $this->_blobProperties->setContentMD5($contentMD5); } - + /** * Gets cache control. * @@ -215,7 +215,7 @@ public function getCacheControl() { return $this->_blobProperties->getCacheControl(); } - + /** * Sets cacheControl. * @@ -227,7 +227,7 @@ public function setCacheControl($cacheControl) { $this->_blobProperties->setCacheControl($cacheControl); } - + /** * Gets content disposition. * @@ -237,7 +237,7 @@ public function getContentDisposition() { return $this->_blobProperties->getContentDisposition(); } - + /** * Sets contentDisposition. * diff --git a/src/Blob/Models/SetBlobPropertiesResult.php b/src/Blob/Models/SetBlobPropertiesResult.php index 550d29b..ba49de9 100644 --- a/src/Blob/Models/SetBlobPropertiesResult.php +++ b/src/Blob/Models/SetBlobPropertiesResult.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ - + namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Blob\Internal\BlobResources as Resources; @@ -43,7 +43,7 @@ class SetBlobPropertiesResult private $_lastModified; private $_etag; private $_sequenceNumber; - + /** * Creates SetBlobPropertiesResult from response headers. * @@ -69,10 +69,10 @@ public static function create(array $headers) Resources::X_MS_BLOB_SEQUENCE_NUMBER, $headers )); - + return $result; } - + /** * Gets blob lastModified. * @@ -118,7 +118,7 @@ protected function setETag($etag) Validate::canCastAsString($etag, 'etag'); $this->_etag = $etag; } - + /** * Gets blob sequenceNumber. *