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

Commit 89e7bcd

Browse files
authored
Merge pull request #117 from XiaoningLiu/v1.0.0
V1.0.0
2 parents e1702ae + 9bd52d4 commit 89e7bcd

427 files changed

Lines changed: 5443 additions & 8882 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
.cache.properties
55
composer.lock
66
test-file-*
7-
7+
.idea
8+
.php_cs.cache
9+
cache.properties
10+
output.txt
811
/vendor/*
912
/output/*
1013
/build/*
11-
/doc/*
12-
13-
14-
14+
/doc/*

BreakingChanges.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
**Note: This changelog is deprecated starting with version 1.0.0, please refer to the ChangeLog.md in each package for future change logs.**
2+
3+
Tracking Breaking changes in 1.0.0
4+
5+
All
6+
* Split azure-storage composer package into azure-storage-blob, azure-storage-table, azure-storage-queue, azure-storage-file and azure-storage-common packages.
7+
* Removed `ServiceBuilder.php`, moved static builder methods into `BlobRestProxy`, `TableRestProxy`, `QueueRestProxy` and `FileRestProxy`.
8+
* Moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
9+
* Moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
10+
* Moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
11+
* Moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
12+
* `CommonMiddleWare` constructor requires storage service version as parameter now.
13+
* `AccessPolicy` class is now an abstract class, added children classes `BlobAccessPolicy`, `ContainerAccessPolicy`, `TableAccessPolicy`, `QueueAccessPolicy`, `FileAccessPolicy` and `ShareAccessPolicy`.
14+
* Deprecated PHP 5.5 support.
15+
16+
Blob
17+
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
18+
* Option parameter type of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent` changed and added `setUseTransactionalMD5` method.
19+
20+
Table
21+
* Removed `dataSerializer` parameter from `TableRextProxy` constructor.
22+
* Will change variable type according to EdmType specified when serializing table entity values.
23+
24+
Queue
25+
* Removed `dataSerializer` parameter from `QueueRextProxy` constructor.
26+
27+
File
28+
* Removed `dataSerializer` parameter from `FileRextProxy` constructor.
29+
* Option parameter type of `FileRestProxy::CreateFileFromContent` changed and added `setUseTransactionalMD5` method.
30+
131
Tracking Breaking changes in 0.19.0
232

333
Blob

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ If you intend to contribute to the project, please make sure you've followed the
33
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.
44

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

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

4950
### Testing Features
5051
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.

ChangeLog.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
1+
**Note: This changelog is deprecated starting with version 1.0.0, please refer to the ChangeLog.md in each package for future change logs.**
2+
3+
2018.01 - version 1.0.0
4+
5+
All
6+
* Split azure-storage composer package into azure-storage-blob, azure-storage-table, azure-storage-queue, azure-storage-file and azure-storage-common packages.
7+
* Removed `ServiceBuilder.php`, moved static builder methods into `BlobRestProxy`, `TableRestProxy`, `QueueRestProxy` and `FileRestProxy`.
8+
* Moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
9+
* Moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
10+
* Moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
11+
* Moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
12+
* `CommonMiddleWare` constructor requires storage service version as parameter now.
13+
* `AccessPolicy` class is now an abstract class, added children classes `BlobAccessPolicy`, `ContainerAccessPolicy`, `TableAccessPolicy`, `QueueAccessPolicy`, `FileAccessPolicy` and `ShareAccessPolicy`.
14+
* Fixed a bug that `Utilities::allZero()` will return true for non-zero data chunks.
15+
* Deprecated PHP 5.5 support.
16+
17+
Blob
18+
* Created `BlobSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
19+
* Added static builder methods `createBlobService` and `createContainerAnonymousAccess` into `BlobRestProxy`.
20+
* Added `setUseTransactionalMD5` method for options of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
21+
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
22+
* Fixed a bug that CopyBlobFromURLOptions not found.
23+
24+
Table
25+
* Created `TableSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateTableServiceSharedAccessSignatureToken()` into `TableSharedAccessSignatureHelper`.
26+
* Added static builder methods `createTableService` into `TableRestProxy`.
27+
* Removed `dataSerializer` parameter from `TableRextProxy` constructor.
28+
* Will change variable type according to EdmType specified when serializing table entity values.
29+
30+
Queue
31+
* Created `QueueSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateQueueServiceSharedAccessSignatureToken()` into `QueueSharedAccessSignatureHelper`.
32+
* Added static builder methods `createQueueService` into `QueueRestProxy`.
33+
* Removed `dataSerializer` parameter from `QueueRextProxy` constructor.
34+
35+
File
36+
* Created `FileSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateFileServiceSharedAccessSignatureToken()` into `FileSharedAccessSignatureHelper`.
37+
* Added static builder methods `createFileService` into `FileRestProxy`.
38+
* Added `setUseTransactionalMD5` method for option of `FileRestProxy::CreateFileFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
39+
* Removed `dataSerializer` parameter from `FileRextProxy` constructor.
40+
141
2017.09 - version 0.19.1
242

3-
ALL
43+
All
444
* Fixed a syntax error for PHP 5.5 and 5.6 in `MicrosoftAzure\Storage\Common\Internal::Utilities:isoDate`.
545

646
2017.09 - version 0.19.0
747

8-
ALL
48+
All
949
* Fixed wrong `XmlSerializer` in ServiceException.php.
1050
* Fixed formatting of non-UTC dates when using instances of `DateTime` to generate shared access signatures.
1151
* Fixed class loading errors on case-sensitive file systems when testing.

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# Microsoft Azure Storage SDK for PHP - GA Preview
1+
# Microsoft Azure Storage PHP Client Libraries
22

3-
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/).
3+
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/).
44

5-
This project is now in GA Preview stage.
6-
7-
[![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage/v/stable)](https://packagist.org/packages/microsoft/azure-storage)
5+
* azure-storage-blob [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-blob/v/stable)](https://packagist.org/packages/microsoft/azure-storage-blob)
6+
* azure-storage-table [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-table/v/stable)](https://packagist.org/packages/microsoft/azure-storage-table)
7+
* azure-storage-queue [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-queue/v/stable)](https://packagist.org/packages/microsoft/azure-storage-queue)
8+
* azure-storage-file [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-file/v/stable)](https://packagist.org/packages/microsoft/azure-storage-file)
9+
* azure-storage-common [![Latest Stable Version](https://poser.pugx.org/microsoft/azure-storage-common/v/stable)](https://packagist.org/packages/microsoft/azure-storage-common)
810

911
> **Note**
1012
>
1113
> * 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.
12-
> * If you need big file or 64-bit integer support, please install PHP 7 64-bit version.
14+
> * If you need big file (larger than 2GB) or 64-bit integer support, please install PHP 7 64-bit version.
1315
1416
# Features
1517

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

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

3035
# Getting Started
3136
## Minimum Requirements
3237

33-
* PHP 5.5 or above
38+
* PHP 5.6 or above
3439
* See [composer.json](composer.json) for dependencies
3540
* Required extension for PHP:
3641
php_fileinfo.dll
3742
php_mbstring.dll
3843
php_openssl.dll
3944
php_xsl.dll
4045

41-
* Recommanded extension for PHP:
46+
* Recommended extension for PHP:
4247
php_curl.dll
4348

4449
## Download Source Code
@@ -55,7 +60,10 @@ To get the source code from GitHub, type
5560
```json
5661
{
5762
"require": {
58-
"microsoft/azure-storage": "*"
63+
"microsoft/azure-storage-blob": "*",
64+
"microsoft/azure-storage-table": "*",
65+
"microsoft/azure-storage-queue": "*",
66+
"microsoft/azure-storage-file": "*"
5967
}
6068
}
6169
```
@@ -75,9 +83,9 @@ There are four basic steps that have to be performed before you can make a call
7583

7684
* Include the namespaces you are going to use.
7785

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

80-
use MicrosoftAzure\Storage\Common\ServicesBuilder;
88+
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
8189

8290
To process exceptions you need:
8391

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

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

99+
Or:
100+
101+
BlobEndpoint=myBlobEndpoint;QueueEndpoint=myQueueEndpoint;TableEndpoint=myTableEndpoint;FileEndpoint=myFileEndpoint;SharedAccessSignature=sasToken
91102

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

94105
```PHP
95-
$tableClient = ServicesBuilder::getInstance()->createTableService($connectionString);
96-
$blobClient = ServicesBuilder::getInstance()->createBlobService($connectionString);
97-
$queueClient = ServicesBuilder::getInstance()->createQueueService($connectionString);
106+
$blobClient = BlobRestProxy::createBlobService($connectionString);
107+
$tableClient = TableRestProxy::createTableService($connectionString);
108+
$queueClient = QueueRestProxy::createQueueService($connectionString);
109+
$fileClient = FileRestProxy::createFileService($connectionString);
98110
```
99111
### Using Middlewares
100112
To specify the middlewares, user have to create an array with middlewares
@@ -109,7 +121,7 @@ applied to each of the API call for a rest proxy. These middlewares will always
109121
be invoked after the middlewares in the `$requestOptions`.
110122
e.g.:
111123
```
112-
$tableClient = ServicesBuilder::getInstance()->createTableService(
124+
$tableClient = TableRestProxy::createTableService(
113125
$connectionString,
114126
$optionsWithMiddlewares
115127
);
@@ -142,11 +154,9 @@ You can find samples in the [sample folder](samples)
142154
143155
# Migrate from [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/)
144156
145-
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.
157+
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.
146158
147-
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).
148-
149-
Please note that this library is still in preview and may contain more breaking changes in upcoming releases.
159+
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).
150160
151161
# Need Help?
152162
@@ -157,5 +167,4 @@ Be sure to check out the Microsoft Azure [Developer Forums on Stack Overflow](ht
157167
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/).
158168
You can find more details for contributing in the [CONTRIBUTING.md](CONTRIBUTING.md).
159169
160-
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.
161-
170+
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.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Tracking Breaking changes in 1.0.0
2+
3+
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
4+
* Option parameter type of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent` changed and added `setUseTransactionalMD5` method.
5+
* Deprecated PHP 5.5 support.

azure-storage-blob/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

azure-storage-blob/ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2018.01 - version 1.0.0
2+
3+
* Created `BlobSharedAccessSignatureHelper` and moved method `SharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken()` into `BlobSharedAccessSignatureHelper`.
4+
* Added static builder methods `createBlobService` and `createContainerAnonymousAccess` into `BlobRestProxy`.
5+
* Removed `dataSerializer` parameter from `BlobRextProxy` constructor.
6+
* Added `setUseTransactionalMD5` method for options of `BlobRestProxy::CreateBlockBlob` and `BlobRestProxy::CreatePageBlobFromContent`. Default false, enabling transactional MD5 validation will take more cpu and memory resources.
7+
* Fixed a bug that CopyBlobFromURLOptions not found.
8+
* Deprecated PHP 5.5 support.

azure-storage-blob/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Microsoft Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)