PageRenderTime 23ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/amazon-web-services/vendor/aws/README.md

https://gitlab.com/gregtyka/helloworld1234
Markdown | 184 lines | 158 code | 26 blank | 0 comment | 0 complexity | d702a24968b7ce5ea0bebbef193f447e MD5 | raw file
  1. # AWS SDK for PHP
  2. [![@awsforphp on Twitter](http://img.shields.io/badge/twitter-%40awsforphp-blue.svg?style=flat)](https://twitter.com/awsforphp)
  3. [![Total Downloads](https://img.shields.io/packagist/dt/aws/aws-sdk-php.svg?style=flat)](https://packagist.org/packages/aws/aws-sdk-php)
  4. [![Build Status](https://img.shields.io/travis/aws/aws-sdk-php.svg?style=flat)](https://travis-ci.org/aws/aws-sdk-php)
  5. [![Apache 2 License](https://img.shields.io/packagist/l/aws/aws-sdk-php.svg?style=flat)](http://aws.amazon.com/apache-2-0/)
  6. [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/aws/aws-sdk-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
  7. The **AWS SDK for PHP** enables PHP developers to use [Amazon Web Services][aws]
  8. in their PHP code, and build robust applications and software using services
  9. like Amazon S3, Amazon DynamoDB, Amazon Glacier, etc. You can get started in
  10. minutes by [installing the SDK through Composer][docs-installation] or by
  11. downloading a single zip or phar file from our [latest release][latest-release].
  12. ## Resources
  13. * [User Guide][docs-guide] For in-depth getting started and usage information
  14. * [API Docs][docs-api] For operations, parameters, responses, and examples
  15. * [Blog][sdk-blog] Tips & tricks, articles, and announcements
  16. * [Sample Project][sdk-sample] - A quick, sample project to help get you started
  17. * [Forum][sdk-forum] Ask questions, get help, and give feedback
  18. * [Issues][sdk-issues] Report issues and submit pull requests
  19. (see [Apache 2.0 License][sdk-license])
  20. * [@awsforphp][sdk-twitter] Follow us on Twitter
  21. * [Building Apps with Version 3 of the AWS SDK for PHP](http://youtu.be/STrtR89f5Pc) video from AWS
  22. re:Invent 2014
  23. ## Features
  24. * Provides easy-to-use HTTP clients for all supported AWS
  25. [services][docs-services], [regions][docs-rande], and authentication
  26. protocols.
  27. * Is built for PHP 5.3.3+ and is compliant with [PSR-0], [PSR-1], and [PSR-2].
  28. * Is easy to install through [Composer][install-packagist], or by downloading
  29. the phar or zip file of our [latest release][latest-release].
  30. * Is built on [Guzzle v3][guzzle], and utilizes many of its features, including
  31. persistent connections, parallel requests, events and plugins
  32. (via [Symfony2 EventDispatcher][symfony2-events]), service descriptions,
  33. [over-the-wire logging][docs-wire-logging], caching, flexible batching, and
  34. request retrying with truncated exponential backoff.
  35. * Provides convenience features including easy response pagination via
  36. [Iterators][docs-iterators], resource [Waiters][docs-waiters], and simple
  37. [modelled responses][docs-models].
  38. * Allows you to [sync local directories to Amazon S3 buckets][docs-s3-sync].
  39. * Provides a [multipart uploader tool][docs-s3-multipart] for Amazon S3 and
  40. Amazon Glacier that can be paused and resumed.
  41. * Provides an [Amazon S3 Stream Wrapper][docs-streamwrapper], so that you can
  42. use PHP's native file handling functions to interact with your S3 buckets and
  43. objects like a local filesystem.
  44. * Provides the [Amazon DynamoDB Session Handler][docs-ddbsh] for easily scaling
  45. sessions on a fast, NoSQL database.
  46. * Automatically uses [IAM Instance Profile Credentials][aws-iam-credentials] on
  47. configured Amazon EC2 instances.
  48. ## Getting Started
  49. 1. **Sign up for AWS** Before you begin, you need to
  50. [sign up for an AWS account][docs-signup] and retrieve your AWS credentials.
  51. 1. **Minimum requirements** To run the SDK, your system will need to meet the
  52. [minimum requirements][docs-requirements], including having **PHP 5.3.3+**
  53. compiled with the cURL extension and cURL 7.16.2+ compiled with OpenSSL and
  54. zlib.
  55. 1. **Install the SDK** Using [Composer] is the recommended way to install the
  56. AWS SDK for PHP. The SDK is available via [Packagist] under the
  57. [`aws/aws-sdk-php`][install-packagist] package. Please see the
  58. [Installation section of the User Guide][docs-installation] for more
  59. detailed information about installing the SDK through Composer and other
  60. means.
  61. 1. **Using the SDK** The best way to become familiar with how to use the SDK
  62. is to read the [User Guide][docs-guide]. The
  63. [Getting Started Guide][docs-quickstart] will help you become familiar with
  64. the basic concepts, and there are also specific guides for each of the
  65. [supported services][docs-services].
  66. ## Quick Example
  67. ### Upload a File to Amazon S3
  68. ```php
  69. <?php
  70. require 'vendor/autoload.php';
  71. use Aws\S3\S3Client;
  72. use Aws\S3\Exception\S3Exception;
  73. // Instantiate an S3 client
  74. $s3 = S3Client::factory();
  75. // Upload a publicly accessible file. The file size, file type, and MD5 hash
  76. // are automatically calculated by the SDK.
  77. try {
  78. $s3->putObject(array(
  79. 'Bucket' => 'my-bucket',
  80. 'Key' => 'my-object',
  81. 'Body' => fopen('/path/to/file', 'r'),
  82. 'ACL' => 'public-read',
  83. ));
  84. } catch (S3Exception $e) {
  85. echo "There was an error uploading the file.\n";
  86. }
  87. ```
  88. You can also use the even easier `upload()` method, which will automatically do
  89. either single or multipart uploads, as needed.
  90. ```php
  91. try {
  92. $resource = fopen('/path/to/file', 'r');
  93. $s3->upload('my-bucket', 'my-object', $resource, 'public-read');
  94. } catch (S3Exception $e) {
  95. echo "There was an error uploading the file.\n";
  96. }
  97. ```
  98. ### More Examples
  99. * [Get an object from Amazon S3 and save it to a file][example-s3-getobject]
  100. * [Upload a large file to Amazon S3 in parts][example-s3-multipart]
  101. * [Put an item in your Amazon DynamoDB table][example-dynamodb-putitem]
  102. * [Send a message to your Amazon SQS queue][example-sqs-sendmessage]
  103. * Please browse the [User Guide][docs-guide] and [API docs][docs-api] or check
  104. out our [AWS SDK Development Blog][sdk-blog] for even more examples and
  105. tutorials.
  106. ### Related Projects
  107. * [AWS Service Provider for Laravel][mod-laravel]
  108. * [AWS SDK ZF2 Module][mod-zf2]
  109. * [AWS Service Provider for Silex][mod-silex]
  110. * [Guzzle v3][guzzle-docs] PHP HTTP client and framework
  111. * Other [AWS SDKs & Tools][aws-tools] (e.g., js, cli, ruby, python, java, etc.)
  112. [sdk-website]: http://aws.amazon.com/sdkforphp
  113. [sdk-forum]: https://forums.aws.amazon.com/forum.jspa?forumID=80
  114. [sdk-issues]: https://github.com/aws/aws-sdk-php/issues
  115. [sdk-license]: http://aws.amazon.com/apache2.0/
  116. [sdk-blog]: http://blogs.aws.amazon.com/php
  117. [sdk-twitter]: https://twitter.com/awsforphp
  118. [sdk-sample]: http://aws.amazon.com/developers/getting-started/php
  119. [install-packagist]: https://packagist.org/packages/aws/aws-sdk-php
  120. [latest-release]: https://github.com/aws/aws-sdk-php/releases/latest
  121. [docs-api]: http://docs.aws.amazon.com/aws-sdk-php/latest/index.html
  122. [docs-guide]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/index.html
  123. [docs-contribution]: https://github.com/aws/aws-sdk-php/blob/master/CONTRIBUTING.md
  124. [docs-performance]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/performance.html
  125. [docs-migration]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/migration-guide.html
  126. [docs-signup]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/awssignup.html
  127. [docs-requirements]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/requirements.html
  128. [docs-installation]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html
  129. [docs-quickstart]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html
  130. [docs-iterators]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html#iterators
  131. [docs-waiters]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/feature-waiters.html
  132. [docs-models]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/feature-models.html
  133. [docs-exceptions]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html#error-handling
  134. [docs-wire-logging]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/faq.html#how-can-i-see-what-data-is-sent-over-the-wire
  135. [docs-services]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/index.html#supported-services
  136. [docs-ddbsh]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/feature-dynamodb-session-handler.html
  137. [docs-rande]: http://docs.aws.amazon.com/general/latest/gr/rande.html
  138. [docs-streamwrapper]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#amazon-s3-stream-wrapper
  139. [docs-s3-sync]: http://blogs.aws.amazon.com/php/post/Tx2W9JAA7RXVOXA/Syncing-Data-with-Amazon-S3
  140. [docs-s3-multipart]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#uploading-large-files-using-multipart-uploads
  141. [aws]: http://aws.amazon.com
  142. [aws-iam-credentials]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingIAM.html#UsingIAMrolesWithAmazonEC2Instances
  143. [aws-tools]: http://aws.amazon.com/tools
  144. [guzzle]: https://github.com/guzzle/guzzle3
  145. [guzzle-docs]: https://guzzle3.readthedocs.org
  146. [composer]: http://getcomposer.org
  147. [packagist]: http://packagist.org
  148. [psr-0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
  149. [psr-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
  150. [psr-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
  151. [symfony2-events]: http://symfony.com/doc/2.3/components/event_dispatcher/introduction.html
  152. [example-sqs-sendmessage]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-sqs.html#sending-messages
  153. [example-s3-getobject]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#saving-objects-to-a-file
  154. [example-s3-multipart]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#uploading-large-files-using-multipart-uploads
  155. [example-dynamodb-putitem]: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-dynamodb.html#adding-items
  156. [mod-laravel]: https://github.com/aws/aws-sdk-php-laravel
  157. [mod-zf2]: https://github.com/aws/aws-sdk-php-zf2
  158. [mod-silex]: https://github.com/aws/aws-sdk-php-silex