Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #117 from XiaoningLiu/v1.0.0
Browse files Browse the repository at this point in the history
V1.0.0
  • Loading branch information
vinjiang authored Jan 11, 2018
2 parents e1702ae + 9bd52d4 commit 89e7bcd
Show file tree
Hide file tree
Showing 427 changed files with 5,443 additions and 8,882 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
.cache.properties
composer.lock
test-file-*

.idea
.php_cs.cache
cache.properties
output.txt
/vendor/*
/output/*
/build/*
/doc/*



/doc/*
30 changes: 30 additions & 0 deletions BreakingChanges.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
**Note: This changelog is deprecated starting with version 1.0.0, please refer to the ChangeLog.md in each package for future change logs.**

Tracking Breaking changes in 1.0.0

All
* Split azure-storage composer package into azure-storage-blob, azure-storage-table, azure-storage-queue, azure-storage-file and azure-storage-common packages.
* Removed `ServiceBuilder.php`, moved static builder methods into `BlobRestProxy`, `TableRestProxy`, `QueueRestProxy` and `FileRestProxy`.
* Moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
* `CommonMiddleWare` constructor requires storage service version as parameter now.
* `AccessPolicy` class is now an abstract class, added children classes `BlobAccessPolicy`, `ContainerAccessPolicy`, `TableAccessPolicy`, `QueueAccessPolicy`, `FileAccessPolicy` and `ShareAccessPolicy`.
* Deprecated PHP 5.5 support.

Blob
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
* Option parameter type of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent` changed and added `setUseTransactionalMD5` method.

Table
* Removed `dataSerializer` parameter from `TableRextProxy` constructor.
* Will change variable type according to EdmType specified when serializing table entity values.

Queue
* Removed `dataSerializer` parameter from `QueueRextProxy` constructor.

File
* Removed `dataSerializer` parameter from `FileRextProxy` constructor.
* Option parameter type of `FileRestProxy::CreateFileFromContent` changed and added `setUseTransactionalMD5` method.

Tracking Breaking changes in 0.19.0

Blob
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ If you intend to contribute to the project, please make sure you've followed the
The Azure Storage development team uses [Eclipse for PHP Developers](http://www.eclipse.org/downloads/packages/eclipse-php-developers/mars2) so instructions will be tailored to that preference. However, any preferred IDE or other toolset should be usable.

### Install
* PHP 5.5, 5.6 or 7.0
* PHP 5.6 or 7.0 above
* [Eclipse for PHP Developers](http://www.eclipse.org/downloads/packages/eclipse-php-developers/mars2)
* [Composer](https://getcomposer.org/) for php packages and tools management.
* [Apache Ant](http://ant.apache.org/manual/install.html) to drive build scripts.
Expand Down Expand Up @@ -42,9 +42,10 @@ Please make sure there's no data inside the storage account used for test. Other
### Running
You can use the following commands to run tests:

* All unit tests: ``ant phpunit`` or ``phpunit -c phpunit.xml.dist``
* All functional tests: ``ant phpunit-ft`` or ``phpunit -c phpunit.functional.dist.xml``
* One particular test case: ``phpunit -c phpunit.dist.xml --filter <case name>`` or ``phpunit -c phpunit.functional.dist.xml --filter <case name>``
* All tests: ``ant phpunit`` or ``phpunit -c phpunit.xml.dist``
* All unit tests: ``ant phpunit-ut``
* All functional tests: ``ant phpunit-ft``
* One particular test case: ``phpunit -c phpunit.dist.xml --filter <case name>``

### Testing Features
As you develop a feature, you'll need to write tests to ensure quality. Your changes should be covered by both unit tests and functional tests. The unit tests and functional tests codes should be placed under tests/Unit and tests/Functional respectively. You should also run existing tests related to your change to address any unexpected breaks.
Expand Down
44 changes: 42 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,51 @@
**Note: This changelog is deprecated starting with version 1.0.0, please refer to the ChangeLog.md in each package for future change logs.**

2018.01 - version 1.0.0

All
* Split azure-storage composer package into azure-storage-blob, azure-storage-table, azure-storage-queue, azure-storage-file and azure-storage-common packages.
* Removed `ServiceBuilder.php`, moved static builder methods into `BlobRestProxy`, `TableRestProxy`, `QueueRestProxy` and `FileRestProxy`.
* Moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
* Moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
* `CommonMiddleWare` constructor requires storage service version as parameter now.
* `AccessPolicy` class is now an abstract class, added children classes `BlobAccessPolicy`, `ContainerAccessPolicy`, `TableAccessPolicy`, `QueueAccessPolicy`, `FileAccessPolicy` and `ShareAccessPolicy`.
* Fixed a bug that `Utilities::allZero()` will return true for non-zero data chunks.
* Deprecated PHP 5.5 support.

Blob
* Created `BlobSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
* Added static builder methods `createBlobService` and `createContainerAnonymousAccess` into `BlobRestProxy`.
* Added `setUseTransactionalMD5` method for options of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
* Fixed a bug that CopyBlobFromURLOptions not found.

Table
* Created `TableSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
* Added static builder methods `createTableService` into `TableRestProxy`.
* Removed `dataSerializer` parameter from `TableRextProxy` constructor.
* Will change variable type according to EdmType specified when serializing table entity values.

Queue
* Created `QueueSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
* Added static builder methods `createQueueService` into `QueueRestProxy`.
* Removed `dataSerializer` parameter from `QueueRextProxy` constructor.

File
* Created `FileSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
* Added static builder methods `createFileService` into `FileRestProxy`.
* Added `setUseTransactionalMD5` method for option of `FileRestProxy::CreateFileFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
* Removed `dataSerializer` parameter from `FileRextProxy` constructor.

2017.09 - version 0.19.1

ALL
All
* Fixed a syntax error for PHP 5.5 and 5.6 in `MicrosoftAzure\Storage\Common\Internal::Utilities:isoDate`.

2017.09 - version 0.19.0

ALL
All
* Fixed wrong `XmlSerializer` in ServiceException.php.
* Fixed formatting of non-UTC dates when using instances of `DateTime` to generate shared access signatures.
* Fixed class loading errors on case-sensitive file systems when testing.
Expand Down
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Microsoft Azure Storage SDK for PHP - GA Preview
# Microsoft Azure Storage PHP Client Libraries

This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage services (blobs, tables and queues). For documentation on how to host PHP applications on Microsoft Azure, please see the [Microsoft Azure PHP Developer Center](http://www.windowsazure.com/en-us/develop/php/).
This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage services (blobs, tables, queues and files). For documentation on how to host PHP applications on Microsoft Azure, please see the [Microsoft Azure PHP Developer Center](http://www.windowsazure.com/en-us/develop/php/).

This project is now in GA Preview stage.

[![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage/v/stable)](https://packagist.org/packages/microsoft/azure-storage)
* azure-storage-blob [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-blob/v/stable)](https://packagist.org/packages/microsoft/azure-storage-blob)
* azure-storage-table [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-table/v/stable)](https://packagist.org/packages/microsoft/azure-storage-table)
* azure-storage-queue [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-queue/v/stable)](https://packagist.org/packages/microsoft/azure-storage-queue)
* azure-storage-file [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-file/v/stable)](https://packagist.org/packages/microsoft/azure-storage-file)
* azure-storage-common [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-common/v/stable)](https://packagist.org/packages/microsoft/azure-storage-common)

> **Note**
>
> * 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 or 64-bit integer support, please install PHP 7 64-bit version.
> * If you need big file (larger than 2GB) or 64-bit integer support, please install PHP 7 64-bit version.
# Features

Expand All @@ -24,21 +26,24 @@ This project is now in GA Preview stage.
* Queues
* create, list, and delete queues, and work with queue metadata and properties
* create, get, peek, update, delete messages
* Files
* create, list, and delete file shares and directories
* create, delete and download files

Please check details on [API reference documents](http://azure.github.io/azure-storage-php).

# Getting Started
## Minimum Requirements

* PHP 5.5 or above
* 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

* Recommanded extension for PHP:
* Recommended extension for PHP:
php_curl.dll

## Download Source Code
Expand All @@ -55,7 +60,10 @@ To get the source code from GitHub, type
```json
{
"require": {
"microsoft/azure-storage": "*"
"microsoft/azure-storage-blob": "*",
"microsoft/azure-storage-table": "*",
"microsoft/azure-storage-queue": "*",
"microsoft/azure-storage-file": "*"
}
}
```
Expand All @@ -75,9 +83,9 @@ There are four basic steps that have to be performed before you can make a call

* Include the namespaces you are going to use.

To create any Microsoft Azure service client you need to use the **ServicesBuilder** class:
To create any Microsoft Azure service client you need to use the rest proxy classes, such as **BlobRestProxy** class:

use MicrosoftAzure\Storage\Common\ServicesBuilder;
use MicrosoftAzure\Storage\Blob\BlobRestProxy;

To process exceptions you need:

Expand All @@ -88,13 +96,17 @@ There are four basic steps that have to be performed before you can make a call

DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]

Or:

BlobEndpoint=myBlobEndpoint;QueueEndpoint=myQueueEndpoint;TableEndpoint=myTableEndpoint;FileEndpoint=myFileEndpoint;SharedAccessSignature=sasToken

* Instantiate a client object - a wrapper around the available calls for the given service.

```PHP
$tableClient = ServicesBuilder::getInstance()->createTableService($connectionString);
$blobClient = ServicesBuilder::getInstance()->createBlobService($connectionString);
$queueClient = ServicesBuilder::getInstance()->createQueueService($connectionString);
$blobClient = BlobRestProxy::createBlobService($connectionString);
$tableClient = TableRestProxy::createTableService($connectionString);
$queueClient = QueueRestProxy::createQueueService($connectionString);
$fileClient = FileRestProxy::createFileService($connectionString);
```
### Using Middlewares
To specify the middlewares, user have to create an array with middlewares
Expand All @@ -109,7 +121,7 @@ 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.:
```
$tableClient = ServicesBuilder::getInstance()->createTableService(
$tableClient = TableRestProxy::createTableService(
$connectionString,
$optionsWithMiddlewares
);
Expand Down Expand Up @@ -142,11 +154,9 @@ You can find samples in the [sample folder](samples)
# Migrate from [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/)
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 (including SAS, CORS, append blob, file service, etc) as well as improvement on existing APIs.
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 SDK for PHP v0.10.2 shares almost the same interface as the storage blobs, tables and queues APIs in Azure SDK for PHP v0.4.3. However, there are some minor breaking changes need to be addressed during your migration. You can find the details in [BreakingChanges.md](BreakingChanges.md).
Please note that this library is still in preview and may contain more breaking changes in upcoming releases.
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?
Expand All @@ -157,5 +167,4 @@ 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.
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.
5 changes: 5 additions & 0 deletions azure-storage-blob/BreakingChanges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Tracking Breaking changes in 1.0.0

* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
* Option parameter type of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent` changed and added `setUseTransactionalMD5` method.
* Deprecated PHP 5.5 support.
1 change: 1 addition & 0 deletions azure-storage-blob/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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.
8 changes: 8 additions & 0 deletions azure-storage-blob/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2018.01 - version 1.0.0

* Created `BlobSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
* Added static builder methods `createBlobService` and `createContainerAnonymousAccess` into `BlobRestProxy`.
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
* Added `setUseTransactionalMD5` method for options of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
* Fixed a bug that CopyBlobFromURLOptions not found.
* Deprecated PHP 5.5 support.
21 changes: 21 additions & 0 deletions azure-storage-blob/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 89e7bcd

Please sign in to comment.