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

Commit 4cd7470

Browse files
authored
Merge pull request #350 from schoag-msft/schoag-retirement-update
Updated readme. Added retirement notice and general updates for linting.
2 parents 5ff7d09 + 4850201 commit 4cd7470

File tree

1 file changed

+48
-28
lines changed

1 file changed

+48
-28
lines changed

README.md

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Microsoft Azure Storage PHP Client Libraries
1+
# Microsoft Azure Storage PHP Client Libraries (Deprecated)
22

3-
This project will be in Community Support and Azure Storage team commits to validate and release every quarter, as long as there are PRs from community. Azure Storage team is unable to continue to add new features or provide bugfixes.
3+
This project will be in [Community Support](https://azure.github.io/azure-sdk/policies_support.html#package-lifecycle) until 17 March 2024. After this date the project and associated client libraries will be retired permanently. For more details on the retirement and alternatives to using this project, visit [Retirement notice: The Azure Storage PHP client libraries will be retired on 17 March 2024](https://aka.ms/AzStoragePHPSDKRetirement).
4+
5+
---
46

57
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/).
68

@@ -12,10 +14,10 @@ This project provides a set of PHP client libraries that make it easy to access
1214

1315
> **Note**
1416
>
15-
> * 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.
17+
> * If you are looking for the Service Bus, Service Runtime, Service Management or Media Services libraries, please visit [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php).
1618
> * If you need big file (larger than 2GB) or 64-bit integer support, please install PHP 7 64-bit version.
1719
18-
# Features
20+
## Features
1921

2022
* Blobs
2123
* create, list, and delete containers, work with container metadata and permissions, list blobs in container
@@ -34,7 +36,6 @@ This project provides a set of PHP client libraries that make it easy to access
3436

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

37-
# Getting Started
3839
## Minimum Requirements
3940

4041
* PHP 5.6 or above
@@ -52,14 +53,15 @@ Please check details on [API reference documents](http://azure.github.io/azure-s
5253

5354
To get the source code from GitHub, type
5455

55-
```
56+
```shell
5657
git clone https://github.com/Azure/azure-storage-php.git
5758
cd ./azure-storage-php
5859
```
5960

6061
## Install via Composer
6162

6263
1. Create a file named **composer.json** in the root of your project and add the following code to it:
64+
6365
```json
6466
{
6567
"require": {
@@ -70,11 +72,12 @@ cd ./azure-storage-php
7072
}
7173
}
7274
```
73-
2. Download **[composer.phar](http://getcomposer.org/composer.phar)** in your project root.
7475

75-
3. Open a command prompt and execute this in your project root
76+
1. Download **[composer.phar](http://getcomposer.org/composer.phar)** in your project root.
7677

77-
```
78+
1. Open a command prompt and execute this in your project root
79+
80+
```shell
7881
php composer.phar install
7982
```
8083

@@ -102,23 +105,24 @@ use MicrosoftAzure\Storage\Blob\BlobRestProxy;
102105
use MicrosoftAzure\Storage\Common\ServiceException;
103106
```
104107

105-
* 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:
108+
* 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:
106109

107-
```
110+
```json
108111
DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
109112
```
110113

111114
Or:
112115

113-
```
116+
```json
114117
BlobEndpoint=myBlobEndpoint;QueueEndpoint=myQueueEndpoint;TableEndpoint=myTableEndpoint;FileEndpoint=myFileEndpoint;SharedAccessSignature=sasToken
115118
```
116119

117120
Or if AAD authentication is used:
118121

119-
```
122+
```json
120123
BlobEndpoint=myBlobEndpoint;QueueEndpoint=myQueueEndpoint;TableEndpoint=myTableEndpoint;FileEndpoint=myFileEndpoint;AccountName=[yourAccount]
121124
```
125+
122126
Note that account name is required.
123127

124128
* Instantiate a client object - a wrapper around the available calls for the given service.
@@ -131,13 +135,16 @@ $fileClient = FileRestProxy::createFileService($connectionString);
131135
```
132136

133137
Or for AAD authentication:
138+
134139
```php
135140
$blobClient = BlobRestProxy::createBlobServiceWithTokenCredential($token, $connectionString);
136141
$queueClient = QueueRestProxy::createQueueServiceWithTokenCredential($token, $connectionString);
137142
```
143+
138144
Note that Blob and Queue service supports AAD authentication.
139145

140146
### Using Middlewares
147+
141148
To specify the middlewares, user have to create an array with middlewares
142149
and put it in the `$requestOptions` with key 'middlewares'. The sequence of
143150
the array will affect the sequence in which the middleware is invoked. The
@@ -163,8 +170,10 @@ implements `MicrosoftAzure\Storage\Common\Internal\IMiddleware`, or a
163170

164171
User can create self-defined middleware that inherits from `MicrosoftAzure\Storage\Common\Internal\Middlewares\MiddlewareBase`.
165172

166-
### Retrying failures
173+
## Retrying failures
174+
167175
You can use bundled middlewares to retry requests in case they fail for some reason. First you create the middleware:
176+
168177
```php
169178
$retryMiddleware = RetryMiddlewareFactory::create(
170179
RetryMiddlewareFactory::GENERAL_RETRY_TYPE, // Specifies the retry logic
@@ -176,6 +185,7 @@ $retryMiddleware = RetryMiddlewareFactory::create(
176185
```
177186

178187
Then you add the middleware when creating the service as explained above:
188+
179189
```php
180190
$optionsWithMiddlewares = [
181191
'middlewares' = [
@@ -189,40 +199,50 @@ $tableClient = TableRestProxy::createTableService(
189199
```
190200

191201
Or by pushing it to the existing service:
202+
192203
```php
193204
$tableClient->pushMiddleware($retryMiddleware);
194205
```
195206

196207
Following errors are not retried in current retry middleware:
197-
- Authentication failures.
198-
- "Resource Not Found" errors.
199-
- Guzzle request exceptions that does not bear an HTTP response, e.g. failed to open stream, or cURL Connection reset by peer, etc.
208+
209+
* Authentication failures.
210+
* "Resource Not Found" errors.
211+
* Guzzle request exceptions that does not bear an HTTP response, e.g. failed to open stream, or cURL Connection reset by peer, etc.
200212
*Note:* Community contribution to cover the Guzzle request exceptions are welcomed.
201213

202-
#### Retry types
203-
- `RetryMiddlewareFactory::GENERAL_RETRY_TYPE` - General type of logic that handles retry
204-
- `RetryMiddlewareFactory::APPEND_BLOB_RETRY_TYPE` - For the append blob retry only, currently the same as the general type
214+
### Retry types
215+
216+
* `RetryMiddlewareFactory::GENERAL_RETRY_TYPE` - General type of logic that handles retry
217+
* `RetryMiddlewareFactory::APPEND_BLOB_RETRY_TYPE` * For the append blob retry only, currently the same as the general type
205218

206-
#### Interval accumulations
207-
- `RetryMiddlewareFactory::LINEAR_INTERVAL_ACCUMULATION` - The interval will be increased linearly, the *nth* retry will have a wait time equal to *n * interval*
208-
- `RetryMiddlewareFactory::EXPONENTIAL_INTERVAL_ACCUMULATION` - The interval will be increased exponentially, the *nth* retry will have a wait time equal to *pow(2, n) * interval*
219+
### Interval accumulations
220+
221+
* `RetryMiddlewareFactory::LINEAR_INTERVAL_ACCUMULATION` - The interval will be increased linearly, the *nth* retry will have a wait time equal to *n \* interval*
222+
* `RetryMiddlewareFactory::EXPONENTIAL_INTERVAL_ACCUMULATION` - The interval will be increased exponentially, the *nth* retry will have a wait time equal to *pow(2, n) \* interval*
209223

210224
### Using proxies
225+
211226
To use proxies during HTTP requests, set system variable `HTTP_PROXY` and the proxy will be used.
212227

213228
## Troubleshooting
229+
214230
### Error: Unable to get local issuer certificate
231+
215232
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:
216233

217-
1. Download the cacert.pem file from [cURL site](http://curl.haxx.se/docs/caextract.html).
234+
1. Download the cacert.pem file from [cURL site](http://curl.haxx.se/docs/caextract.html).
218235

219236
2. Then either:
220237
* Open your php.ini file and add the following line:
238+
221239
```ini
222240
curl.cainfo = "<absolute path to cacert.pem>"
223241
```
242+
224243
OR
225244
* Point to the cacert in the options when creating the Relevant Proxy.
245+
226246
```php
227247
//example of creating the FileRestProxy
228248
$options["http"] = ["verify" => "<absolute path to cacert.pem>"];
@@ -233,19 +253,19 @@ cURL can't verify the validity of Microsoft certificate when trying to issue a r
233253

234254
You can find samples in the [samples folder](https://github.com/Azure/azure-storage-php/tree/master/samples).
235255

236-
# Migrate from [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/)
256+
## Migrate from [Azure SDK for PHP](https://github.com/Azure/azure-sdk-for-php/)
237257

238258
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.
239259

240260
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).
241261

242-
# Need Help?
262+
## Need Help?
243263

244-
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.
264+
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.
245265

246266
Please note this project will be in Community Support and Azure Storage team commits to validate and release every quarter, as long as there are PRs from community. Azure Storage team is unable to continue to add new features or provide bugfixes.
247267

248-
# Contribute Code or Provide Feedback
268+
## Contribute Code or Provide Feedback
249269

250270
If you would like to become an active contributor to this project please follow the instructions provided in [Azure Projects Contribution Guidelines](https://opensource.microsoft.com/program/#program-contributing).
251271
You can find more details for contributing in the [CONTRIBUTING.md](CONTRIBUTING.md).

0 commit comments

Comments
 (0)