Skip to content

Commit f5dc6ad

Browse files
committed
version v0.10.0 release
1 parent b704437 commit f5dc6ad

File tree

319 files changed

+66449
-1
lines changed

Some content is hidden

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

319 files changed

+66449
-1
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.buildpath
2+
.settings/*
3+
.project
4+
.cache.properties
5+
6+
/vendor/*
7+
/output/*
8+
9+
10+

BreakingChanges.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Tracking Breaking Changes in 0.10.0
2+
ALL
3+
* Remove all pear dependencies: HTTP_Request2, Mail_mime, and Mail_mimeDecode. Use Guzzle as underlying http client library.
4+
* Change root namespace from "WindowsAzure" to "MicrosoftAzure/Storage".
5+
* When set metadata operations contains invalid characters, it throws a ServiceException with 400 bad request error instead of Http_Request2_LogicException.
6+
7+
BLOB
8+
* MicrosoftAzure\Storage\Blob\Models\Blocks.setBlockId now requires a base64 encoded string.

CONTRIBUTING.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
If you intend to contribute to the project, please make sure you've followed the instructions provided in the [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
2+
## Project Setup
3+
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.
4+
5+
### Install
6+
* PHP 5.5, 5.6 or 7.0
7+
* [Eclipse for PHP Developers](http://www.eclipse.org/downloads/packages/eclipse-php-developers/mars2)
8+
* [Composer](https://getcomposer.org/) for php packages and tools management.
9+
* [Apache Ant](http://ant.apache.org/manual/install.html) to drive build scripts.
10+
11+
### Development Environment Setup
12+
To get the source code of the SDK via **git** just type:
13+
14+
```bash
15+
git clone https://github.com/Azure/azure-storage-php.git
16+
cd ./azure-storage-php
17+
```
18+
19+
Run Composer to install all php package dependencies and tools:
20+
21+
```bash
22+
composer install
23+
```
24+
25+
### Open project from Eclipse
26+
* Select **File->New->PHP Project**
27+
* Enter the project name (e.g. azure-storage-php)
28+
* Select **Create project at existing location** and navigate to the root directory of your local git repository
29+
* Click **Finish**
30+
31+
## Tests
32+
33+
### Configuration
34+
Authenticated access to Azure Storage is required to run the tests. Set the environment variable AZURE_STORAGE_CONNECTION_STRING to a valid connection string. You may use the below as a template:
35+
36+
```bash
37+
Set AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=<Account>;AccountKey=<Key>
38+
```
39+
40+
Please make sure there's no data inside the storage account used for test. Otherwise, test may fail because of the existing data.
41+
42+
### Running
43+
You can use the following commands to run tests:
44+
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>``
48+
49+
### Testing Features
50+
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.
51+
52+
## Pull Requests
53+
54+
### Guidelines
55+
The following are the minimum requirements for any pull request that must be met before contributions can be accepted.
56+
* Make sure you've signed the CLA before you start working on any change.
57+
* Discuss any proposed contribution with the team via a GitHub issue **before** starting development.
58+
* Code must be professional quality
59+
* You should strive to mimic the style with which we have written the library
60+
* Clean, well-commented, well-designed code
61+
* Try to limit the number of commits for a feature to 1-2. If you end up having too many we may ask you to squash your changes into fewer commits.
62+
* [ChangeLog.md](ChangeLog.md) needs to be updated describing the new change
63+
* Thoroughly test your feature
64+
65+
### Branching Policy
66+
Changes should be based on the `dev` branch. We're following [semver](http://semver.org/). We generally release any breaking changes in the next major version (e.g. 1.0, 2.0) and non-breaking changes in the next minor or major version (e.g. 2.1, 2.2).
67+
68+
### Review Process
69+
We expect all guidelines to be met before accepting a pull request. As such, we will work with you to address issues we find by leaving comments in your code. Please understand that it may take a few iterations before the code is accepted as we maintain high standards on code quality. Once we feel comfortable with a contribution, we will validate the change and accept the pull request.
70+
71+
72+
Thank you for any contributions! Please let the team know if you have any questions or concerns about our contribution policy.

ChangeLog.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2016.04 - version 0.10.0
2+
ALL
3+
* Separated Azure Storage APIs in Azure-SDK-for-PHP to establish an independent release cycle.
4+
* Remove all pear dependencies: HTTP_Request2, Mail_mime, and Mail_mimeDecode. Use Guzzle as underlying http client library.
5+
* Update storage REST API version to 2015-04-05.
6+
* Change root namespace from "WindowsAzure" to "MicrosoftAzure/Storage".
7+
* When set metadata operations contains invalid characters, it throws a ServiceException with 400 bad request error instead of Http_Request2_LogicException.
8+
9+
Blob
10+
* Fixed the issue that upload large block blob fails. (https://github.com/Azure/azure-sdk-for-php/pull/757)
11+
* MicrosoftAzure\Storage\Blob\Models\Blocks.setBlockId now requires a base64 encoded string.
12+
13+
Table
14+
* MicrosoftAzure\Storage\Table\Models\Property.getEdmType now returns EdmType::STRING instead of null if the property data type is not set in server.

LICENSE

+21
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.

README.md

+114-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,114 @@
1-
# azure-storage-php
1+
# Microsoft Azure Storage SDK for PHP
2+
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/).
4+
5+
For documentation on how to use azure storage service, please see:
6+
* Blob. [How-to use the Blob service](https://azure.microsoft.com/en-us/documentation/articles/storage-php-how-to-use-blobs/).
7+
* Table. [How-to use the Table service](https://azure.microsoft.com/en-us/documentation/articles/storage-php-how-to-use-table-storage/).
8+
* Queue. [How-to use the Queue service](https://azure.microsoft.com/en-us/documentation/articles/storage-php-how-to-use-queues/).
9+
10+
> **Note**
11+
>
12+
> 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.
13+
14+
# Features
15+
16+
* Blobs
17+
* create, list, and delete containers, work with container metadata and permissions, list blobs in container
18+
* create block and page blobs (from a stream or a string), work with blob blocks and pages, delete blobs
19+
* work with blob properties, metadata, leases, snapshot a blob
20+
* Tables
21+
* create and delete tables
22+
* create, query, insert, update, merge, and delete entities
23+
* batch operations
24+
* Queues
25+
* create, list, and delete queues, and work with queue metadata and properties
26+
* create, get, peek, update, delete messages
27+
28+
# Getting Started
29+
## Minimum Requirements
30+
31+
* PHP 5.5 or above
32+
* See [composer.json](composer.json) for dependencies
33+
34+
35+
## Download Source Code
36+
37+
To get the source code from GitHub, type
38+
39+
git clone https://github.com/Azure/azure-storage-php.git
40+
cd ./azure-storage-php
41+
42+
43+
## Install via Composer
44+
45+
1. Create a file named **composer.json** in the root of your project and add the following code to it:
46+
```json
47+
{
48+
"require": {
49+
"microsoft/azure-storage": "*"
50+
}
51+
}
52+
```
53+
2. Download **[composer.phar](http://getcomposer.org/composer.phar)** in your project root.
54+
55+
3. Open a command prompt and execute this in your project root
56+
57+
php composer.phar install
58+
59+
## Usage
60+
61+
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.
62+
63+
* First, include the autoloader script:
64+
65+
require_once "vendor/autoload.php";
66+
67+
* Include the namespaces you are going to use.
68+
69+
To create any Microsoft Azure service client you need to use the **ServicesBuilder** class:
70+
71+
use MicrosoftAzure\Storage\Common\ServicesBuilder;
72+
73+
To process exceptions you need:
74+
75+
use MicrosoftAzure\Storage\Common\ServiceException;
76+
77+
78+
* 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:
79+
80+
DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
81+
82+
83+
* Instantiate a client object - a wrapper around the available calls for the given service.
84+
85+
```PHP
86+
$tableClient = ServicesBuilder::getInstance()->createTableService($connectionString);
87+
$blobClient = ServicesBuilder::getInstance()->createBlobService($connectionString);
88+
$queueClient = ServicesBuilder::getInstance()->createQueueService($connectionString);
89+
```
90+
91+
## Code samples
92+
93+
You can find samples in the [sample folder](samples)
94+
95+
96+
# Migrate from [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/)
97+
98+
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.
99+
100+
For now, Microsoft Azure Storage SDK for PHP v0.10.0 shares almost the same interface as the storage blobs, tables and queues APIs in Azure SDK for PHP v0.4.1. However, there are some minor breaking changes need to be addressed during your migration. You can find the details in [BreakingChanges.md](BreakingChanges.md).
101+
102+
Please note that this library is still in preview and may contain more breaking changes in upcoming releases.
103+
104+
# Need Help?
105+
106+
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.
107+
108+
# Contribute Code or Provide Feedback
109+
110+
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/).
111+
You can find more details for contributing in the [CONTRIBUTING.md](CONTRIBUTING.md).
112+
113+
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.
114+

0 commit comments

Comments
 (0)