From 7e4725933552e413816d94d075458a50f6fa3f41 Mon Sep 17 00:00:00 2001 From: "Vincent Jiang (LEI)" Date: Thu, 26 Apr 2018 15:56:44 +0800 Subject: [PATCH] source code copied from azure-storage-php for v1.1.0-file release --- .gitignore | 288 ------------------ ChangeLog.md | 8 + README.md | 97 +++--- composer.json | 4 +- src/File/FileRestProxy.php | 104 +++---- src/File/Internal/FileResources.php | 2 +- src/File/Internal/IFile.php | 2 +- src/File/Models/CopyFileResult.php | 16 +- src/File/Models/CreateDirectoryOptions.php | 8 +- .../Models/CreateFileFromContentOptions.php | 2 +- src/File/Models/CreateFileOptions.php | 22 +- src/File/Models/CreateShareOptions.php | 12 +- src/File/Models/Directory.php | 2 +- src/File/Models/File.php | 4 +- src/File/Models/FileAccessPolicy.php | 2 +- src/File/Models/FileProperties.php | 26 +- src/File/Models/FileServiceOptions.php | 2 +- .../Models/GetDirectoryMetadataResult.php | 2 +- .../Models/GetDirectoryPropertiesResult.php | 14 +- src/File/Models/GetFileMetadataResult.php | 2 +- src/File/Models/GetFileOptions.php | 2 +- src/File/Models/GetFileResult.php | 12 +- src/File/Models/GetShareACLResult.php | 10 +- src/File/Models/GetSharePropertiesResult.php | 8 +- src/File/Models/GetShareStatsResult.php | 6 +- .../Models/ListDirectoriesAndFilesOptions.php | 2 +- .../Models/ListDirectoriesAndFilesResult.php | 8 +- src/File/Models/ListFileRangesResult.php | 18 +- src/File/Models/ListSharesOptions.php | 2 +- src/File/Models/ListSharesResult.php | 10 +- src/File/Models/PutFileRangeOptions.php | 4 +- src/File/Models/Share.php | 6 +- src/File/Models/ShareACL.php | 2 +- src/File/Models/ShareAccessPolicy.php | 2 +- src/File/Models/ShareProperties.php | 8 +- 35 files changed, 229 insertions(+), 490 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 97cbd4f..02042c7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,11 @@ +2018.04 - version 1.1.0 + +* MD files are modified for better readability and formatting. +* CACERT can now be set when creating RestProxies using `$options` parameter. +* 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 `FileSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`. diff --git a/README.md b/README.md index 1baae43..5705b16 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-file/v/stable)](https://packagist.org/packages/microsoft/azure-storage-file) > **Note** -> +> > * This [repository](https://github.com/azure/azure-storage-file-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. @@ -24,70 +24,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-file": "*" - } - } +{ + "require": { + "microsoft/azure-storage-file": "*" + } +} ``` 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 **ListSharesOptions** class: - use MicrosoftAzure\Storage\File\FileRestProxy; +```php +use MicrosoftAzure\Storage\File\FileRestProxy; +``` 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: - - FileEndpoint=[myFileEndpoint];SharedAccessSignature=[sasToken] + +``` +FileEndpoint=[myFileEndpoint];SharedAccessSignature=[sasToken] +``` * Instantiate a client object - a wrapper around the available calls for the given service. - ```PHP - $fileClient = FileRestProxy::createFileService($connectionString); - ``` +```php +$fileClient = FileRestProxy::createFileService($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 @@ -100,7 +112,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 $fileClient = ListSharesOptions::createFileService( $connectionString, $optionsWithMiddlewares @@ -120,12 +132,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" => ""]; + FileRestProxy::createFileService($connectionString, $options); + ``` ## Code samples @@ -137,7 +156,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. @@ -146,5 +165,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 f42b6e1..20e0b39 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "microsoft/azure-storage-file", - "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 File APIs.", "keywords": [ "php", "azure", "storage", "sdk", "file" ], "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/File/FileRestProxy.php b/src/File/FileRestProxy.php index 2e81e90..e851b02 100644 --- a/src/File/FileRestProxy.php +++ b/src/File/FileRestProxy.php @@ -198,17 +198,17 @@ private function getSharePropertiesAsyncImpl( $operation == 'properties' || $operation == 'metadata', Resources::FILE_SHARE_PROPERTIES_OPERATION_INVALID ); - + $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = $this->createPath($share); - + if (is_null($options)) { $options = new FileServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -280,12 +280,12 @@ private function setSharePropertiesAsyncImpl( Utilities::validateMetadata($properties); $headers = $this->generateMetadataHeaders($properties); } - + $method = Resources::HTTP_PUT; $postParams = array(); $queryParams = array(); $path = $this->createPath($share); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -442,7 +442,7 @@ private function multiplePutRangeConcurrentAsync( $options ); } - + /** * Returns a list of the shares under the specified account @@ -474,11 +474,11 @@ public function listSharesAsync(ListSharesOptions $options = null) $queryParams = array(); $postParams = array(); $path = Resources::EMPTY_STRING; - + if (is_null($options)) { $options = new ListSharesOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_COMP, @@ -565,13 +565,13 @@ public function createShareAsync( ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($share, 'share'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(Resources::QP_REST_TYPE => 'share'); $path = $this->createPath($share); - + if (is_null($options)) { $options = new CreateShareOptions(); } @@ -635,13 +635,13 @@ public function deleteShareAsync( ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($share, 'share'); - + $method = Resources::HTTP_DELETE; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -651,7 +651,7 @@ public function deleteShareAsync( Resources::QP_TIMEOUT, $options->getTimeout() ); - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -746,7 +746,7 @@ public function setSharePropertiesAsync( 'properties' ); } - + /** * Returns only user-defined metadata for the specified share. * @@ -824,7 +824,7 @@ public function setShareMetadataAsync( 'metadata' ); } - + /** * Gets the access control list (ACL) for the share. * @@ -857,18 +857,18 @@ public function getShareAclAsync( FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share); $statusCode = Resources::STATUS_OK; - + if (is_null($options)) { $options = new FileServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -886,7 +886,7 @@ public function getShareAclAsync( ); $dataSerializer = $this->dataSerializer; - + $promise = $this->sendAsync( $method, $headers, @@ -900,7 +900,7 @@ public function getShareAclAsync( return $promise->then(function ($response) use ($dataSerializer) { $responseHeaders = HttpFormatter::formatHeaders($response->getHeaders()); - + $etag = Utilities::tryGetValue($responseHeaders, Resources::ETAG); $modified = Utilities::tryGetValue( $responseHeaders, @@ -908,7 +908,7 @@ public function getShareAclAsync( ); $modifiedDate = Utilities::convertToDateTime($modified); $parsed = $dataSerializer->unserialize($response->getBody()); - + return GetShareAclResult::create( $etag, $modifiedDate, @@ -916,7 +916,7 @@ public function getShareAclAsync( ); }, null); } - + /** * Sets the ACL and any share-level access policies for the share. * @@ -955,18 +955,18 @@ public function setShareAclAsync( ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($acl, 'acl'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share); $body = $acl->toXml($this->dataSerializer); - + if (is_null($options)) { $options = new FileServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1028,17 +1028,17 @@ public function getShareStats($share, FileServiceOptions $options = null) public function getShareStatsAsync($share, FileServiceOptions $options = null) { Validate::canCastAsString($share, 'share'); - + $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = $this->createPath($share); - + if (is_null($options)) { $options = new FileServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1116,17 +1116,17 @@ public function listDirectoriesAndFilesAsync( Validate::notNull($share, 'share'); Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new ListDirectoriesAndFilesOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_REST_TYPE, @@ -1217,7 +1217,7 @@ public function createDirectoryAsync( Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path, 'path'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); @@ -1292,7 +1292,7 @@ public function deleteDirectoryAsync( $postParams = array(); $queryParams = array(Resources::QP_REST_TYPE => 'directory'); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1359,7 +1359,7 @@ public function getDirectoryPropertiesAsync( $postParams = array(); $queryParams = array(Resources::QP_REST_TYPE => 'directory'); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1429,7 +1429,7 @@ public function getDirectoryMetadataAsync( $postParams = array(); $queryParams = array(Resources::QP_REST_TYPE => 'directory'); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1606,7 +1606,7 @@ public function createFileAsync( Utilities::validateMetadata($options->getMetadata()); $headers = $this->generateMetadataHeaders($options->getMetadata()); - + $this->addOptionalHeader( $headers, Resources::X_MS_TYPE, @@ -1722,7 +1722,7 @@ public function deleteFileAsync( $postParams = array(); $queryParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1784,13 +1784,13 @@ public function getFileAsync( ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); - + $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new GetFileOptions(); } @@ -1800,7 +1800,7 @@ public function getFileAsync( Resources::QP_TIMEOUT, $options->getTimeout() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_RANGE, @@ -1813,7 +1813,7 @@ public function getFileAsync( ); $options->setIsStreaming(true); - + return $this->sendAsync( $method, $headers, @@ -1827,7 +1827,7 @@ public function getFileAsync( $metadata = Utilities::getMetadataArray( HttpFormatter::formatHeaders($response->getHeaders()) ); - + return GetFileResult::create( HttpFormatter::formatHeaders($response->getHeaders()), $response->getBody(), @@ -1880,7 +1880,7 @@ public function getFilePropertiesAsync( $queryParams = array(); $postParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1949,12 +1949,12 @@ public function setFilePropertiesAsync( Validate::canCastAsString($path, 'path'); $headers = array(); - + $method = Resources::HTTP_PUT; $postParams = array(); $queryParams = array(Resources::QP_COMP => 'properties'); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -1964,7 +1964,7 @@ public function setFilePropertiesAsync( Resources::QP_TIMEOUT, $options->getTimeout() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_CACHE_CONTROL, @@ -2063,7 +2063,7 @@ public function getFileMetadataAsync( $postParams = array(); $queryParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } @@ -2750,17 +2750,17 @@ public function abortCopyAsync( Validate::notNullOrEmpty($share, 'share'); Validate::notNullOrEmpty($path, 'path'); Validate::notNullOrEmpty($copyID, 'copyID'); - + $method = Resources::HTTP_PUT; $headers = array(); $postParams = array(); $queryParams = array(); $path = $this->createPath($share, $path); - + if (is_null($options)) { $options = new FileServiceOptions(); } - + $this->addOptionalQueryParam( $queryParams, Resources::QP_TIMEOUT, @@ -2778,13 +2778,13 @@ public function abortCopyAsync( Resources::QP_COPY_ID, $copyID ); - + $this->addOptionalHeader( $headers, Resources::X_MS_COPY_ACTION, 'abort' ); - + return $this->sendAsync( $method, $headers, diff --git a/src/File/Internal/FileResources.php b/src/File/Internal/FileResources.php index c694bed..6bc731a 100644 --- a/src/File/Internal/FileResources.php +++ b/src/File/Internal/FileResources.php @@ -41,7 +41,7 @@ class FileResources extends Resources { // @codingStandardsIgnoreStart - const FILE_SDK_VERSION = '1.0.0'; + const FILE_SDK_VERSION = '1.1.0'; const STORAGE_API_LATEST_VERSION = '2016-05-31'; // Error messages diff --git a/src/File/Internal/IFile.php b/src/File/Internal/IFile.php index 98d21de..3e88ca8 100644 --- a/src/File/Internal/IFile.php +++ b/src/File/Internal/IFile.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\File\Internal; use MicrosoftAzure\Storage\File\Models as FileModels; diff --git a/src/File/Models/CopyFileResult.php b/src/File/Models/CopyFileResult.php index ab4e8bb..a59005b 100644 --- a/src/File/Models/CopyFileResult.php +++ b/src/File/Models/CopyFileResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -44,7 +44,7 @@ class CopyFileResult private $etag; private $copyID; private $copyStatus; - + /** * Creates CopyFileResult object from parsed response header. * @@ -58,7 +58,7 @@ public static function create(array $headers) { $result = new CopyFileResult(); $headers = array_change_key_case($headers); - + $date = $headers[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); @@ -66,10 +66,10 @@ public static function create(array $headers) $result->setCopyID($headers[Resources::X_MS_COPY_ID]); $result->setETag($headers[Resources::ETAG]); $result->setLastModified($date); - + return $result; } - + /** * Gets file lastModified. * @@ -115,7 +115,7 @@ protected function setETag($etag) Validate::canCastAsString($etag, 'etag'); $this->etag = $etag; } - + /** * Gets file copyID. * @@ -138,7 +138,7 @@ protected function setCopyID($copyID) Validate::canCastAsString($copyID, 'copyID'); $this->copyID = $copyID; } - + /** * Gets copyStatus * @@ -148,7 +148,7 @@ public function getCopyStatus() { return $this->copyStatus; } - + /** * Sets copyStatus * diff --git a/src/File/Models/CreateDirectoryOptions.php b/src/File/Models/CreateDirectoryOptions.php index fe92f66..71e94c2 100644 --- a/src/File/Models/CreateDirectoryOptions.php +++ b/src/File/Models/CreateDirectoryOptions.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\File\Models; /** @@ -37,7 +37,7 @@ class CreateDirectoryOptions extends FileServiceOptions { private $metadata; - + /** * Gets user defined metadata. * @@ -47,7 +47,7 @@ public function getMetadata() { return $this->metadata; } - + /** * Sets user defined metadata. This metadata should be added without the header * prefix (x-ms-meta-*). @@ -60,7 +60,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/File/Models/CreateFileFromContentOptions.php b/src/File/Models/CreateFileFromContentOptions.php index f92ccf2..8f319b5 100644 --- a/src/File/Models/CreateFileFromContentOptions.php +++ b/src/File/Models/CreateFileFromContentOptions.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\File\Models; use MicrosoftAzure\Storage\Common\Models\TransactionalMD5Trait; diff --git a/src/File/Models/CreateFileOptions.php b/src/File/Models/CreateFileOptions.php index 3e6c114..caea684 100644 --- a/src/File/Models/CreateFileOptions.php +++ b/src/File/Models/CreateFileOptions.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -46,7 +46,7 @@ class CreateFileOptions extends FileServiceOptions private $contentDisposition; private $metadata; private $contentLength; - + /** * Gets File contentType. * @@ -68,7 +68,7 @@ public function setContentType($contentType) { $this->contentType = $contentType; } - + /** * Gets contentEncoding. * @@ -90,7 +90,7 @@ public function setContentEncoding($contentEncoding) { $this->contentEncoding = $contentEncoding; } - + /** * Gets contentLanguage. * @@ -112,7 +112,7 @@ public function setContentLanguage($contentLanguage) { $this->contentLanguage = $contentLanguage; } - + /** * Gets contentMD5. * @@ -134,7 +134,7 @@ public function setContentMD5($contentMD5) { $this->contentMD5 = $contentMD5; } - + /** * Gets cacheControl. * @@ -144,7 +144,7 @@ public function getCacheControl() { return $this->cacheControl; } - + /** * Sets cacheControl. * @@ -156,7 +156,7 @@ public function setCacheControl($cacheControl) { $this->cacheControl = $cacheControl; } - + /** * Gets content disposition. * @@ -166,7 +166,7 @@ public function getContentDisposition() { return $this->contentDisposition; } - + /** * Sets content disposition. * @@ -178,7 +178,7 @@ public function setContentDisposition($contentDisposition) { $this->contentDisposition = $contentDisposition; } - + /** * Gets File metadata. * @@ -200,7 +200,7 @@ public function setMetadata(array $metadata) { $this->metadata = $metadata; } - + /** * Gets File contentLength. * diff --git a/src/File/Models/CreateShareOptions.php b/src/File/Models/CreateShareOptions.php index 165fc75..72e577c 100644 --- a/src/File/Models/CreateShareOptions.php +++ b/src/File/Models/CreateShareOptions.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -40,7 +40,7 @@ class CreateShareOptions extends FileServiceOptions { private $quota; private $metadata; - + /** * Gets share quota. * @@ -50,7 +50,7 @@ public function getQuota() { return $this->quota; } - + /** * Specifies the maximum size of the share, in gigabytes. * Must be greater than 0, and less than or equal to 5TB (5120) @@ -64,7 +64,7 @@ public function setQuota($quota) Validate::isInteger($quota, 'quota'); $this->quota = $quota; } - + /** * Gets user defined metadata. * @@ -74,7 +74,7 @@ public function getMetadata() { return $this->metadata; } - + /** * Sets user defined metadata. This metadata should be added without the header * prefix (x-ms-meta-*). @@ -87,7 +87,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/File/Models/Directory.php b/src/File/Models/Directory.php index 72bd5bf..d658b07 100644 --- a/src/File/Models/Directory.php +++ b/src/File/Models/Directory.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\File\Models; use MicrosoftAzure\Storage\File\Internal\FileResources as Resources; diff --git a/src/File/Models/File.php b/src/File/Models/File.php index ff7d4cb..348c9da 100644 --- a/src/File/Models/File.php +++ b/src/File/Models/File.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -63,7 +63,7 @@ public function setName($name) { $this->name = $name; } - + /** * Gets file length. * diff --git a/src/File/Models/FileAccessPolicy.php b/src/File/Models/FileAccessPolicy.php index 64a8469..916d067 100644 --- a/src/File/Models/FileAccessPolicy.php +++ b/src/File/Models/FileAccessPolicy.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\File\Models; use MicrosoftAzure\Storage\Common\Models\AccessPolicy; diff --git a/src/File/Models/FileProperties.php b/src/File/Models/FileProperties.php index 453f06c..c5f4c55 100644 --- a/src/File/Models/FileProperties.php +++ b/src/File/Models/FileProperties.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\File\Models; use MicrosoftAzure\Storage\File\Internal\FileResources as Resources; @@ -74,7 +74,7 @@ public static function createFromHttpHeaders(array $parsed) $clean = array_change_key_case($parsed); $lastModified = Utilities::tryGetValue($parsed, Resources::LAST_MODIFIED); - + $result->setLastModified( Utilities::rfc1123ToDateTime($lastModified) ); @@ -197,7 +197,7 @@ protected function setETag($etag) { $this->etag = $etag; } - + /** * Gets file contentType. * @@ -219,7 +219,7 @@ public function setContentType($contentType) { $this->contentType = $contentType; } - + /** * Gets file contentRange. * @@ -241,7 +241,7 @@ protected function setContentRange($contentRange) { $this->contentRange = $contentRange; } - + /** * Gets file contentLength. * @@ -264,7 +264,7 @@ public function setContentLength($contentLength) Validate::isInteger($contentLength, 'contentLength'); $this->contentLength = (int)$contentLength; } - + /** * Gets file contentEncoding. * @@ -307,7 +307,7 @@ public function setContentLanguage($contentLanguage) { $this->contentLanguage = $contentLanguage; } - + /** * Gets file contentMD5. * @@ -373,7 +373,7 @@ public function setCacheControl($cacheControl) { $this->cacheControl = $cacheControl; } - + /** * Gets file contentDisposition. * @@ -395,7 +395,7 @@ public function setContentDisposition($contentDisposition) { $this->contentDisposition = $contentDisposition; } - + /** * Gets file copyCompletionTime. * @@ -417,7 +417,7 @@ protected function setCopyCompletionTime($copyCompletionTime) { $this->copyCompletionTime = $copyCompletionTime; } - + /** * Gets file copyStatusDescription. * @@ -439,7 +439,7 @@ protected function setCopyStatusDescription($copyStatusDescription) { $this->copyStatusDescription = $copyStatusDescription; } - + /** * Gets file lease state. * @@ -461,7 +461,7 @@ protected function setCopyID($copyID) { $this->copyID = $copyID; } - + /** * Gets file lease duration. * @@ -483,7 +483,7 @@ protected function setCopyProgress($copyProgress) { $this->copyProgress = $copyProgress; } - + /** * Gets file copySource. * diff --git a/src/File/Models/FileServiceOptions.php b/src/File/Models/FileServiceOptions.php index 4468252..e001df4 100644 --- a/src/File/Models/FileServiceOptions.php +++ b/src/File/Models/FileServiceOptions.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\File\Models; use MicrosoftAzure\Storage\Common\LocationMode; diff --git a/src/File/Models/GetDirectoryMetadataResult.php b/src/File/Models/GetDirectoryMetadataResult.php index 52bc9fb..da27781 100644 --- a/src/File/Models/GetDirectoryMetadataResult.php +++ b/src/File/Models/GetDirectoryMetadataResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; diff --git a/src/File/Models/GetDirectoryPropertiesResult.php b/src/File/Models/GetDirectoryPropertiesResult.php index 9ff6cd2..c44cc7e 100644 --- a/src/File/Models/GetDirectoryPropertiesResult.php +++ b/src/File/Models/GetDirectoryPropertiesResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -42,7 +42,7 @@ class GetDirectoryPropertiesResult private $lastModified; private $etag; private $metadata; - + /** * Any operation that modifies the share or its properties or metadata * updates the last modified time. Operations on files do not affect the @@ -66,7 +66,7 @@ protected function setLastModified(\DateTime $lastModified) { $this->lastModified = $lastModified; } - + /** * The entity tag for the share. If the request version is 2011-08-18 or * newer, the ETag value will be in quotes. @@ -89,7 +89,7 @@ protected function setETag($etag) { $this->etag = $etag; } - + /** * Gets user defined metadata. * @@ -99,7 +99,7 @@ public function getMetadata() { return $this->metadata; } - + /** * Sets user defined metadata. This metadata should be added without the * header prefix (x-ms-meta-*). @@ -112,7 +112,7 @@ protected function setMetadata(array $metadata) { $this->metadata = $metadata; } - + /** * Create an instance using the response headers from the API call. * @@ -137,7 +137,7 @@ public static function create(array $responseHeaders) )); $result->setMetadata($metadata); $result->setLastModified($date); - + return $result; } } diff --git a/src/File/Models/GetFileMetadataResult.php b/src/File/Models/GetFileMetadataResult.php index 93d8257..49e3463 100644 --- a/src/File/Models/GetFileMetadataResult.php +++ b/src/File/Models/GetFileMetadataResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; diff --git a/src/File/Models/GetFileOptions.php b/src/File/Models/GetFileOptions.php index 86ff904..37f5121 100644 --- a/src/File/Models/GetFileOptions.php +++ b/src/File/Models/GetFileOptions.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; diff --git a/src/File/Models/GetFileResult.php b/src/File/Models/GetFileResult.php index fde81fb..266eeed 100644 --- a/src/File/Models/GetFileResult.php +++ b/src/File/Models/GetFileResult.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\File\Models; use Psr\Http\Message\StreamInterface; @@ -41,7 +41,7 @@ class GetFileResult private $properties; private $metadata; private $contentStream; - + /** * Creates GetFileResult from getFile call. * @@ -62,10 +62,10 @@ public static function create( $result->setContentStream($body->detach()); $result->setProperties(FileProperties::createFromHttpHeaders($headers)); $result->setMetadata(is_null($metadata) ? array() : $metadata); - + return $result; } - + /** * Gets file metadata. * @@ -87,7 +87,7 @@ protected function setMetadata(array $metadata) { $this->metadata = $metadata; } - + /** * Gets file properties. * @@ -109,7 +109,7 @@ protected function setProperties(FileProperties $properties) { $this->properties = $properties; } - + /** * Gets file contentStream. * diff --git a/src/File/Models/GetShareACLResult.php b/src/File/Models/GetShareACLResult.php index fb13167..52b8525 100644 --- a/src/File/Models/GetShareACLResult.php +++ b/src/File/Models/GetShareACLResult.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\File\Models; /** @@ -39,7 +39,7 @@ class GetShareACLResult private $shareACL; private $lastModified; private $etag; - + /** * Parses the given array into signed identifiers * @@ -65,7 +65,7 @@ public static function create( return $result; } - + /** * Gets share ACL * @@ -75,7 +75,7 @@ public function getShareAcl() { return $this->shareACL; } - + /** * Sets share ACL * @@ -87,7 +87,7 @@ protected function setShareAcl(ShareACL $shareACL) { $this->shareACL = $shareACL; } - + /** * Gets share lastModified. * diff --git a/src/File/Models/GetSharePropertiesResult.php b/src/File/Models/GetSharePropertiesResult.php index d33f37e..6517cd5 100644 --- a/src/File/Models/GetSharePropertiesResult.php +++ b/src/File/Models/GetSharePropertiesResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; @@ -43,7 +43,7 @@ class GetSharePropertiesResult use MetadataTrait; private $quota; - + /** * Gets file quota. * @@ -65,7 +65,7 @@ protected function setQuota($quota) { $this->quota = $quota; } - + /** * Create an instance using the response headers from the API call. * @@ -83,7 +83,7 @@ public static function create(array $responseHeaders) Resources::X_MS_SHARE_QUOTA, $responseHeaders ))); - + return $result; } } diff --git a/src/File/Models/GetShareStatsResult.php b/src/File/Models/GetShareStatsResult.php index 01eb180..b8d6c8a 100644 --- a/src/File/Models/GetShareStatsResult.php +++ b/src/File/Models/GetShareStatsResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -69,7 +69,7 @@ protected function setShareUsage($shareUsage) { $this->shareUsage = $shareUsage; } - + /** * Create an instance using the response headers from the API call. * @@ -87,7 +87,7 @@ public static function create(array $parsed) Resources::XTAG_SHARE_USAGE, $parsed ))); - + return $result; } } diff --git a/src/File/Models/ListDirectoriesAndFilesOptions.php b/src/File/Models/ListDirectoriesAndFilesOptions.php index bebdf39..ff5c99a 100644 --- a/src/File/Models/ListDirectoriesAndFilesOptions.php +++ b/src/File/Models/ListDirectoriesAndFilesOptions.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; diff --git a/src/File/Models/ListDirectoriesAndFilesResult.php b/src/File/Models/ListDirectoriesAndFilesResult.php index 72bfe46..ceb498a 100644 --- a/src/File/Models/ListDirectoriesAndFilesResult.php +++ b/src/File/Models/ListDirectoriesAndFilesResult.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\File\Models; use MicrosoftAzure\Storage\File\Internal\FileResources as Resources; @@ -125,7 +125,7 @@ public static function create(array $parsedResponse, $location = '') $directories[] = Directory::create($directoryArray); } } - + if ($filesArray != null) { if (array_key_exists(Resources::QP_NAME, $filesArray)) { $filesArray = [$filesArray]; @@ -156,7 +156,7 @@ protected function setDirectories(array $directories) $this->directories[] = clone $directory; } } - + /** * Gets directories. * @@ -181,7 +181,7 @@ protected function setFiles(array $files) $this->files[] = clone $file; } } - + /** * Gets files. * diff --git a/src/File/Models/ListFileRangesResult.php b/src/File/Models/ListFileRangesResult.php index 7923242..b7af29a 100644 --- a/src/File/Models/ListFileRangesResult.php +++ b/src/File/Models/ListFileRangesResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; @@ -45,7 +45,7 @@ class ListFileRangesResult private $etag; private $contentLength; private $ranges; - + /** * Creates ListFileRangesResult object from $parsed response and * $headers in array representation @@ -61,7 +61,7 @@ public static function create(array $headers, array $parsed = null) { $result = new ListFileRangesResult(); $headers = array_change_key_case($headers); - + $date = $headers[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); $fileLength = intval($headers[Resources::X_MS_CONTENT_LENGTH]); @@ -69,7 +69,7 @@ public static function create(array $headers, array $parsed = null) if (!empty($parsed['Range'])) { $rawRanges = Utilities::getArray($parsed['Range']); } - + $ranges = array(); foreach ($rawRanges as $value) { $ranges[] = new Range( @@ -81,10 +81,10 @@ public static function create(array $headers, array $parsed = null) $result->setContentLength($fileLength); $result->setETag($headers[Resources::ETAG]); $result->setLastModified($date); - + return $result; } - + /** * Gets file lastModified. * @@ -130,7 +130,7 @@ protected function setETag($etag) Validate::canCastAsString($etag, 'etag'); $this->etag = $etag; } - + /** * Gets file contentLength. * @@ -153,7 +153,7 @@ protected function setContentLength($contentLength) Validate::isInteger($contentLength, 'contentLength'); $this->contentLength = $contentLength; } - + /** * Gets ranges * @@ -163,7 +163,7 @@ public function getRanges() { return $this->ranges; } - + /** * Sets ranges * diff --git a/src/File/Models/ListSharesOptions.php b/src/File/Models/ListSharesOptions.php index 9bdbcd9..1513afc 100644 --- a/src/File/Models/ListSharesOptions.php +++ b/src/File/Models/ListSharesOptions.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\File\Models; use MicrosoftAzure\Storage\Common\MarkerContinuationTokenTrait; diff --git a/src/File/Models/ListSharesResult.php b/src/File/Models/ListSharesResult.php index 64a70f8..588c02e 100644 --- a/src/File/Models/ListSharesResult.php +++ b/src/File/Models/ListSharesResult.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -93,19 +93,19 @@ public static function create(array $parsedResponse, $location = '') ) ); } - + $result->setMaxResults(Utilities::tryGetValue( $parsedResponse, Resources::QP_MAX_RESULTS )); $shares = array(); $shareArrays = array(); - + if (!empty($parsedResponse[Resources::QP_SHARES])) { $array = $parsedResponse[Resources::QP_SHARES][Resources::QP_SHARE]; $shareArrays = Utilities::getArray($array); } - + foreach ($shareArrays as $shareArray) { $shares[] = Share::create($shareArray); } @@ -128,7 +128,7 @@ protected function setShares(array $shares) $this->shares[] = clone $share; } } - + /** * Gets shares. * diff --git a/src/File/Models/PutFileRangeOptions.php b/src/File/Models/PutFileRangeOptions.php index a072e6d..0dc7822 100644 --- a/src/File/Models/PutFileRangeOptions.php +++ b/src/File/Models/PutFileRangeOptions.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\File\Models; /** @@ -37,7 +37,7 @@ class PutFileRangeOptions extends FileServiceOptions { private $contentMD5; - + /** * Gets contentMD5. * diff --git a/src/File/Models/Share.php b/src/File/Models/Share.php index c75e436..3c21198 100644 --- a/src/File/Models/Share.php +++ b/src/File/Models/Share.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -106,7 +106,7 @@ public function setMetadata(array $metadata = null) { $this->metadata = $metadata; } - + /** * Gets share properties * @@ -116,7 +116,7 @@ public function getProperties() { return $this->properties; } - + /** * Sets share properties * diff --git a/src/File/Models/ShareACL.php b/src/File/Models/ShareACL.php index f9c7c1f..1767e77 100644 --- a/src/File/Models/ShareACL.php +++ b/src/File/Models/ShareACL.php @@ -63,7 +63,7 @@ public static function create(array $parsed = null) { $result = new ShareACL(); $result->fromXmlArray($parsed); - + return $result; } diff --git a/src/File/Models/ShareAccessPolicy.php b/src/File/Models/ShareAccessPolicy.php index bdf2159..99e5360 100644 --- a/src/File/Models/ShareAccessPolicy.php +++ b/src/File/Models/ShareAccessPolicy.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\File\Models; use MicrosoftAzure\Storage\Common\Models\AccessPolicy; diff --git a/src/File/Models/ShareProperties.php b/src/File/Models/ShareProperties.php index 1a224eb..7a98370 100644 --- a/src/File/Models/ShareProperties.php +++ b/src/File/Models/ShareProperties.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\File\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -60,7 +60,7 @@ public static function create(array $parsedResponse) $result->setQuota($parsedResponse[Resources::QP_QUOTA]); return $result; } - + /** * Gets share lastModified. * @@ -82,7 +82,7 @@ public function setLastModified(\DateTime $lastModified) { $this->lastModified = $lastModified; } - + /** * Gets share etag. * @@ -104,7 +104,7 @@ public function setETag($etag) { $this->etag = $etag; } - + /** * Gets share quota. *