├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ ├── documentation.yml │ └── feature-request.yml └── workflows │ ├── closed-issue-message.yml │ ├── handle-stale-discussions.yml │ ├── issue-regression-labeler.yml │ └── stale_issues.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── NOTICE.md ├── README.md ├── composer.json ├── phpunit.xml.dist ├── src └── AwsServiceProvider.php └── tests └── AwsServiceProviderTest.php /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "🐛 Bug Report" 3 | description: Report a bug 4 | title: "(short issue description)" 5 | labels: [bug, needs-triage] 6 | assignees: [] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the bug 12 | description: What is the problem? A clear and concise description of the bug. 13 | validations: 14 | required: true 15 | - type: checkboxes 16 | id: regression 17 | attributes: 18 | label: Regression Issue 19 | description: What is a regression? If it worked in a previous version but doesn't in the latest version, it's considered a regression. In this case, please provide specific version number in the report. 20 | options: 21 | - label: Select this option if this issue appears to be a regression. 22 | required: false 23 | - type: textarea 24 | id: expected 25 | attributes: 26 | label: Expected Behavior 27 | description: | 28 | What did you expect to happen? 29 | validations: 30 | required: true 31 | - type: textarea 32 | id: current 33 | attributes: 34 | label: Current Behavior 35 | description: | 36 | What actually happened? 37 | 38 | Please include full errors, uncaught exceptions, stack traces, and relevant logs. 39 | If service responses are relevant, please include wire logs. 40 | validations: 41 | required: true 42 | - type: textarea 43 | id: reproduction 44 | attributes: 45 | label: Reproduction Steps 46 | description: | 47 | Provide a self-contained, concise snippet of code that can be used to reproduce the issue. 48 | For more complex issues provide a repo with the smallest sample that reproduces the bug. 49 | 50 | Avoid including business logic or unrelated code, it makes diagnosis more difficult. 51 | The code sample should be an SSCCE. See http://sscce.org/ for details. In short, please provide a code sample that we can copy/paste, run and reproduce. 52 | validations: 53 | required: true 54 | - type: textarea 55 | id: solution 56 | attributes: 57 | label: Possible Solution 58 | description: | 59 | Suggest a fix/reason for the bug 60 | validations: 61 | required: false 62 | - type: textarea 63 | id: context 64 | attributes: 65 | label: Additional Information/Context 66 | description: | 67 | Anything else that might be relevant for troubleshooting this bug. Providing context helps us come up with a solution that is most useful in the real world. 68 | validations: 69 | required: false 70 | - type: input 71 | id: sdk-version 72 | attributes: 73 | label: SDK version used 74 | validations: 75 | required: true 76 | - type: input 77 | id: environment 78 | attributes: 79 | label: Environment details (OS name and version, etc.) 80 | validations: 81 | required: true 82 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | contact_links: 4 | - name: 💬 General Question 5 | url: https://github.com/aws/aws-sdk-php-silex/discussions/categories/q-a 6 | about: Please ask and answer questions as a discussion thread 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "📕 Documentation Issue" 3 | description: Report an issue in the API Reference documentation or Developer Guide 4 | title: "(short issue description)" 5 | labels: [documentation, needs-triage] 6 | assignees: [] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the issue 12 | description: A clear and concise description of the issue. 13 | validations: 14 | required: true 15 | 16 | - type: textarea 17 | id: links 18 | attributes: 19 | label: Links 20 | description: | 21 | Include links to affected documentation page(s). 22 | validations: 23 | required: true 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🚀 Feature Request 3 | description: Suggest an idea for this project 4 | title: "(short issue description)" 5 | labels: [feature-request, needs-triage] 6 | assignees: [] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the feature 12 | description: A clear and concise description of the feature you are proposing. 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: use-case 17 | attributes: 18 | label: Use Case 19 | description: | 20 | Why do you need this feature? For example: "I'm always frustrated when..." 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: solution 25 | attributes: 26 | label: Proposed Solution 27 | description: | 28 | Suggest how to implement the addition or change. Please include prototype/workaround/sketch/reference implementation. 29 | validations: 30 | required: false 31 | - type: textarea 32 | id: other 33 | attributes: 34 | label: Other Information 35 | description: | 36 | Any alternative solutions or features you considered, a more detailed explanation, stack traces, related issues, links for context, etc. 37 | validations: 38 | required: false 39 | - type: checkboxes 40 | id: ack 41 | attributes: 42 | label: Acknowledgements 43 | options: 44 | - label: I may be able to implement this feature request 45 | required: false 46 | - label: This feature might incur a breaking change 47 | required: false 48 | - type: input 49 | id: sdk-version 50 | attributes: 51 | label: SDK version used 52 | validations: 53 | required: true 54 | - type: input 55 | id: environment 56 | attributes: 57 | label: Environment details (OS name and version, etc.) 58 | validations: 59 | required: true 60 | -------------------------------------------------------------------------------- /.github/workflows/closed-issue-message.yml: -------------------------------------------------------------------------------- 1 | name: Closed Issue Message 2 | on: 3 | issues: 4 | types: [closed] 5 | jobs: 6 | auto_comment: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: aws-actions/closed-issue-message@v1 10 | with: 11 | # These inputs are both required 12 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 13 | message: | 14 | ### ⚠️COMMENT VISIBILITY WARNING⚠️ 15 | Comments on closed issues are hard for our team to see. 16 | If you need more assistance, please either tag a team member or open a new issue that references this one. 17 | If you wish to keep having a conversation with other community members under this issue feel free to do so. 18 | -------------------------------------------------------------------------------- /.github/workflows/handle-stale-discussions.yml: -------------------------------------------------------------------------------- 1 | name: HandleStaleDiscussions 2 | on: 3 | schedule: 4 | - cron: '0 */4 * * *' 5 | discussion_comment: 6 | types: [created] 7 | 8 | jobs: 9 | handle-stale-discussions: 10 | if: github.repository_owner == 'aws' 11 | name: Handle stale discussions 12 | runs-on: ubuntu-latest 13 | permissions: 14 | discussions: write 15 | steps: 16 | - name: Stale discussions action 17 | uses: aws-github-ops/handle-stale-discussions@v1 18 | env: 19 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 20 | -------------------------------------------------------------------------------- /.github/workflows/issue-regression-labeler.yml: -------------------------------------------------------------------------------- 1 | # Apply potential regression label on issues 2 | name: issue-regression-label 3 | on: 4 | issues: 5 | types: [opened, edited] 6 | jobs: 7 | add-regression-label: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | steps: 12 | - name: Fetch template body 13 | id: check_regression 14 | uses: actions/github-script@v7 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | TEMPLATE_BODY: ${{ github.event.issue.body }} 18 | with: 19 | script: | 20 | const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i; 21 | const template = `${process.env.TEMPLATE_BODY}` 22 | const match = regressionPattern.test(template); 23 | core.setOutput('is_regression', match); 24 | - name: Manage regression label 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | run: | 28 | if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then 29 | gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }} 30 | else 31 | gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }} 32 | fi 33 | -------------------------------------------------------------------------------- /.github/workflows/stale_issues.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale issues" 2 | 3 | # Controls when the action will run. 4 | on: 5 | schedule: 6 | - cron: "0 0 * * *" 7 | 8 | jobs: 9 | cleanup: 10 | runs-on: ubuntu-latest 11 | name: Stale issue job 12 | steps: 13 | - uses: aws-actions/stale-issue-cleanup@v3 14 | with: 15 | # Setting messages to an empty string will cause the automation to skip 16 | # that category 17 | ancient-issue-message: We have noticed this issue has not recieved attention in 3 years. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. 18 | stale-issue-message: This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. 19 | 20 | # These labels are required 21 | stale-issue-label: closing-soon 22 | exempt-issue-label: no-autoclose 23 | stale-pr-label: no-pr-activity 24 | exempt-pr-label: awaiting-approval 25 | response-requested-label: response-requested 26 | 27 | # Don't set closed-for-staleness label to skip closing very old issues 28 | # regardless of label 29 | closed-for-staleness-label: closed-for-staleness 30 | 31 | # Issue timing 32 | days-before-stale: 7 33 | days-before-close: 4 34 | days-before-ancient: 1095 35 | 36 | # If you don't want to mark a issue as being ancient based on a 37 | # threshold of "upvotes", you can set this here. An "upvote" is 38 | # the total number of +1, heart, hooray, and rocket reactions 39 | # on an issue. 40 | minimum-upvotes-to-exempt: 10 41 | 42 | repo-token: ${{ secrets.GITHUB_TOKEN }} 43 | loglevel: DEBUG 44 | # Set dry-run to true to not perform label or close actions. 45 | # dry-run: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | aws-sdk-php-silex.iml 3 | 4 | composer.lock 5 | composer.phar 6 | phpunit.xml 7 | vendor 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | 3 | language: php 4 | 5 | php: 6 | - 5.5.9 7 | - 5.6 8 | - 7.0 9 | - 7.1 10 | - 7.2 11 | - 7.3 12 | - hhvm 13 | - nightly 14 | 15 | matrix: 16 | allow_failures: 17 | - php: hhvm 18 | - php: nightly 19 | 20 | sudo: false 21 | 22 | install: travis_retry composer install --no-interaction --prefer-source 23 | 24 | script: vendor/bin/phpunit 25 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to the AWS Service Provider for Silex 2 | 3 | Thank you for your interest in contributing to the AWS Service Provider for Silex! 4 | We work hard to provide a high-quality and useful SDK for our AWS services, and 5 | we greatly value feedback and contributions from our community. Whether it's a 6 | new feature, correction, or additional documentation, we welcome your pull requests. 7 | Please submit your [issues][] or [pull requests][pull-requests] through GitHub. 8 | 9 | Jump To: 10 | 11 | * [Bug Reports](_#Bug-Reports_) 12 | * [Feature Requests](_#Feature-Requests_) 13 | * [Code Contributions](_#Code-Contributions_) 14 | 15 | ## How to contribute 16 | 17 | *Before you send us a pull request, please be sure that:* 18 | 19 | 1. You're working from the latest source on the master branch. 20 | 2. You check existing open, and recently closed, pull requests to be sure that 21 | someone else hasn't already addressed the problem. 22 | 3. You create an issue before working on a contribution that will take a significant 23 | amount of your time. 24 | 25 | *Creating a Pull Request* 26 | 27 | 1. Fork the repository. 28 | 2. In your fork, make your change in a branch that's based on this repo's master branch. 29 | 3. Commit the change to your fork, using a clear and descriptive commit message. 30 | 4. Create a pull request, answering any questions in the pull request form. 31 | 32 | For contributions that will take a significant amount of time, open a new issue to pitch 33 | your idea before you get started. Explain the problem and describe the content you want to 34 | see added to the documentation. Let us know if you'll write it yourself or if you'd like us 35 | to help. We'll discuss your proposal with you and let you know whether we're likely to 36 | accept it. 37 | 38 | ## Bug Reports 39 | 40 | Bug reports are accepted through the [Issues][] page. 41 | 42 | Before Submitting: 43 | 44 | * Do a search through the existing issues to make sure it has not already been reported. 45 | If it has, comment your experience or +1 so we prioritize it. 46 | * If possible, upgrade to the latest release of the SDK. It's possible the bug has 47 | already been fixed in the latest version. 48 | 49 | Writing the Bug Report: 50 | 51 | Please ensure that your bug report has the following: 52 | 53 | * A short, descriptive title. Ideally, other community members should be able to get a 54 | good idea of the issue just from reading the title. 55 | * A detailed description of the problem you're experiencing. This should include: 56 | * Expected behavior of the SDK and the actual behavior exhibited. 57 | * Any details of your application environment that may be relevant. 58 | * Debug information, stack trace or logs. 59 | * If you are able to create one, include a Minimal Working Example that reproduces the issue. 60 | * Use Markdown to make the report easier to read; i.e. use code blocks when pasting a 61 | code snippet. 62 | 63 | ## Feature Requests 64 | 65 | Open an [issue][issues] with the following: 66 | 67 | * A short, descriptive title. Ideally, other community members should be able to get a 68 | good idea of the feature just from reading the title. 69 | * A detailed description of the the proposed feature. 70 | * Why it should be added to the SDK. 71 | * If possible, example code to illustrate how it should work. 72 | * Use Markdown to make the request easier to read; 73 | * If you intend to implement this feature, indicate that you'd like to the issue to be assigned to you. 74 | 75 | 76 | ## Code Contributions 77 | 78 | Code contributions to the SDK are done through [Pull Requests][pull-requests]. The list below are guidelines to use when submitting pull requests. These are the 79 | same set of guidelines that the core contributors use when submitting changes, and 80 | we ask the same of all community contributions as well: 81 | 82 | 1. The SDK is released under the [Apache license][license]. Any code you submit 83 | will be released under that license. For substantial contributions, we may 84 | ask you to sign a [Contributor License Agreement (CLA)][cla]. 85 | 2. We follow all of the relevant PSR recommendations from the [PHP Framework 86 | Interop Group][php-fig]. Please submit code that follows these standards. 87 | The [PHP CS Fixer][cs-fixer] tool can be helpful for formatting your code. 88 | 3. We maintain a high percentage of code coverage in our unit tests. If you make 89 | changes to the code, please add, update, and/or remove tests as appropriate. 90 | 4. Static code analysis with [PHPStan][phpstan] is automatically run on the `src` 91 | directory for submitted pull requests. If there is a case that needs to be 92 | ignored by static analysis, please update the `ignoreErrors` section in the 93 | `phpstan.neon` config file in your PR, and point out why this case warrants 94 | ignoring. 95 | 5. If your code does not conform to the PSR standards, does not include adequate 96 | tests, or does not contain a changelog document, we may ask you to update 97 | your pull requests before we accept them. We also reserve the right to deny 98 | any pull requests that do not align with our standards or goals. 99 | 6. If you would like to implement support for a significant feature that is not 100 | yet available in the SDK, please talk to us beforehand to avoid any 101 | duplication of effort. 102 | 7. We greatly appreciate contributions to our User Guide. The docs are written 103 | as a [Sphinx][] website formatted with [reStructuredText][] (very similar to 104 | Markdown). The User Guide is located in another repository. Please go to the 105 | [awsdocs/aws-php-developers-guide](https://github.com/awsdocs/aws-php-developers-guide/). 106 | repository to suggest edits for the User Guide. 107 | 8. If you are working on the SDK, make sure to check out the `Makefile` for some 108 | of the common tasks that we have to do. 109 | 110 | 111 | [issues]: https://github.com/aws/aws-sdk-php-silex/issues 112 | [pull-requests]: https://github.com/aws/aws-sdk-php-silex/pulls 113 | [license]: http://aws.amazon.com/apache2.0/ 114 | [cla]: https://github.com/aws/aws-cla/blob/master/amazon-single-contribution-license.txt 115 | [php-fig]: http://php-fig.org 116 | [cs-fixer]: http://cs.sensiolabs.org/ 117 | [phpstan]: https://github.com/phpstan/phpstan 118 | [sphinx]: http://sphinx-doc.org/ 119 | [restructuredtext]: http://sphinx-doc.org/rest.html 120 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Apache License 2 | Version 2.0, January 2004 3 | 4 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 5 | 6 | ## 1. Definitions. 7 | 8 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 9 | through 9 of this document. 10 | 11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the 12 | License. 13 | 14 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled 15 | by, or are under common control with that entity. For the purposes of this definition, "control" means 16 | (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract 17 | or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial 18 | ownership of such entity. 19 | 20 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 21 | 22 | "Source" form shall mean the preferred form for making modifications, including but not limited to software 23 | source code, documentation source, and configuration files. 24 | 25 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, 26 | including but not limited to compiled object code, generated documentation, and conversions to other media 27 | types. 28 | 29 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, 30 | as indicated by a copyright notice that is included in or attached to the work (an example is provided in the 31 | Appendix below). 32 | 33 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) 34 | the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, 35 | as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not 36 | include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work 37 | and Derivative Works thereof. 38 | 39 | "Contribution" shall mean any work of authorship, including the original version of the Work and any 40 | modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to 41 | Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to 42 | submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of 43 | electronic, verbal, or written communication sent to the Licensor or its representatives, including but not 44 | limited to communication on electronic mailing lists, source code control systems, and issue tracking systems 45 | that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but 46 | excluding communication that is conspicuously marked or otherwise designated in writing by the copyright 47 | owner as "Not a Contribution." 48 | 49 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been 50 | received by Licensor and subsequently incorporated within the Work. 51 | 52 | ## 2. Grant of Copyright License. 53 | 54 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, 55 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare 56 | Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such 57 | Derivative Works in Source or Object form. 58 | 59 | ## 3. Grant of Patent License. 60 | 61 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, 62 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent 63 | license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such 64 | license applies only to those patent claims licensable by such Contributor that are necessarily infringed by 65 | their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such 66 | Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim 67 | or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work 68 | constitutes direct or contributory patent infringement, then any patent licenses granted to You under this 69 | License for that Work shall terminate as of the date such litigation is filed. 70 | 71 | ## 4. Redistribution. 72 | 73 | You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without 74 | modifications, and in Source or Object form, provided that You meet the following conditions: 75 | 76 | 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and 77 | 78 | 2. You must cause any modified files to carry prominent notices stating that You changed the files; and 79 | 80 | 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, 81 | trademark, and attribution notices from the Source form of the Work, excluding those notices that do 82 | not pertain to any part of the Derivative Works; and 83 | 84 | 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that 85 | You distribute must include a readable copy of the attribution notices contained within such NOTICE 86 | file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one 87 | of the following places: within a NOTICE text file distributed as part of the Derivative Works; within 88 | the Source form or documentation, if provided along with the Derivative Works; or, within a display 89 | generated by the Derivative Works, if and wherever such third-party notices normally appear. The 90 | contents of the NOTICE file are for informational purposes only and do not modify the License. You may 91 | add Your own attribution notices within Derivative Works that You distribute, alongside or as an 92 | addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be 93 | construed as modifying the License. 94 | 95 | You may add Your own copyright statement to Your modifications and may provide additional or different license 96 | terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative 97 | Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the 98 | conditions stated in this License. 99 | 100 | ## 5. Submission of Contributions. 101 | 102 | Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by 103 | You to the Licensor shall be under the terms and conditions of this License, without any additional terms or 104 | conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate 105 | license agreement you may have executed with Licensor regarding such Contributions. 106 | 107 | ## 6. Trademarks. 108 | 109 | This License does not grant permission to use the trade names, trademarks, service marks, or product names of 110 | the Licensor, except as required for reasonable and customary use in describing the origin of the Work and 111 | reproducing the content of the NOTICE file. 112 | 113 | ## 7. Disclaimer of Warranty. 114 | 115 | Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor 116 | provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 117 | or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, 118 | MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the 119 | appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of 120 | permissions under this License. 121 | 122 | ## 8. Limitation of Liability. 123 | 124 | In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless 125 | required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any 126 | Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential 127 | damages of any character arising as a result of this License or out of the use or inability to use the Work 128 | (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or 129 | any and all other commercial damages or losses), even if such Contributor has been advised of the possibility 130 | of such damages. 131 | 132 | ## 9. Accepting Warranty or Additional Liability. 133 | 134 | While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, 135 | acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this 136 | License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole 137 | responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold 138 | each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason 139 | of your accepting any such warranty or additional liability. 140 | 141 | END OF TERMS AND CONDITIONS 142 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # AWS Service Provider for Silex 2 | 3 | 4 | 5 | Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"). 8 | You may not use this file except in compliance with the License. 9 | A copy of the License is located at 10 | 11 | 12 | 13 | or in the "license" file accompanying this file. This file is distributed 14 | on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 15 | express or implied. See the License for the specific language governing 16 | permissions and limitations under the License. 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AWS Service Provider for Silex 2 | 3 | [![@awsforphp on Twitter](http://img.shields.io/badge/twitter-%40awsforphp-blue.svg?style=flat)](https://twitter.com/awsforphp) 4 | [![Build Status](https://travis-ci.org/aws/aws-sdk-php-silex.svg)](https://travis-ci.org/aws/aws-sdk-php-silex) 5 | [![Latest Stable Version](https://poser.pugx.org/aws/aws-sdk-php-silex/v/stable.png)](https://packagist.org/packages/aws/aws-sdk-php-silex) 6 | [![Total Downloads](https://poser.pugx.org/aws/aws-sdk-php-silex/downloads.png)](https://packagist.org/packages/aws/aws-sdk-php-silex) 7 | 8 | A simple Silex 2 / Pimple 3 service provider for including the [AWS SDK for PHP](https://github.com/aws/aws-sdk-php). 9 | 10 | note: 11 | If you are using the 1.x Silex version, Use [version 2.x] 12 | (https://github.com/aws/aws-sdk-php-silex/tree/2.0) of this provider. 13 | 14 | Jump To: 15 | * [Getting Started](_#Getting-Started_) 16 | * [Getting Help](_#Getting-Help_) 17 | * [Contributing](_#Contributing_) 18 | * [More Resources](_#Resources_) 19 | 20 | ## Getting Started 21 | 22 | ### Installation 23 | 24 | The AWS Service Provider can be installed via [Composer](http://getcomposer.org) by requiring the 25 | `aws/aws-sdk-php-silex` package in your project's `composer.json`. 26 | 27 | ```json 28 | { 29 | "require": { 30 | "aws/aws-sdk-php-silex": "~3.0" 31 | } 32 | } 33 | ``` 34 | 35 | ### Usage 36 | 37 | Register the AWS Service Provider in your Silex application and provide your AWS SDK for PHP configuration to the app 38 | in the `aws.config` key. `$app['aws.config']` should contain an array of configuration options or the path to a 39 | configuration file. This value is passed directly into `new Aws\Sdk`. 40 | 41 | ```php 42 | register(new AwsServiceProvider(), array( 52 | 'aws.config' => array( 53 | 'version' => 'latest', 54 | 'region' => 'us-east-1', 55 | ) 56 | )); 57 | // Note: You can also specify a path to a config file 58 | // (e.g., 'aws.config' => '/path/to/aws/config/file.php') 59 | 60 | $app->match('/', function () use ($app) { 61 | // Get the Amazon S3 client 62 | $s3 = $app['aws']->createS3(); 63 | 64 | // Create a list of the buckets in your account 65 | $output = "\n"; 70 | 71 | return $output; 72 | }); 73 | 74 | $app->run(); 75 | ``` 76 | 77 | ## Getting Help 78 | 79 | Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them. 80 | 81 | * Ask a question on [StackOverflow](https://stackoverflow.com/) and tag it with [`aws-php-sdk`](http://stackoverflow.com/questions/tagged/aws-php-sdk) 82 | * Come join the AWS SDK for PHP [gitter](https://gitter.im/aws/aws-sdk-php) 83 | * Open a support ticket with [AWS Support](https://console.aws.amazon.com/support/home/) 84 | * If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-php-silex/issues/new/choose) 85 | 86 | This SDK implements AWS service APIs. For general issues regarding the AWS services and their limitations, you may also take a look at the [Amazon Web Services Discussion Forums](https://forums.aws.amazon.com/). 87 | 88 | ### Opening Issues 89 | 90 | If you encounter a bug with `aws-sdk-php-silex` we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of `aws-sdk-php-silex`, PHP version and OS you’re using. Please include a stack trace and reduced repro case when appropriate, too. 91 | 92 | The GitHub issues are intended for bug reports and feature requests. For help and questions with using `aws-sdk-php` please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues lean we can respond in a timely manner. 93 | 94 | ## Contributing 95 | 96 | We work hard to provide a high-quality and useful SDK for our AWS services, and we greatly value feedback and contributions from our community. Please review our [contributing guidelines](./CONTRIBUTING.md) before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution. 97 | 98 | ## Resources 99 | 100 | * [AWS SDK for PHP on Github](http://github.com/aws/aws-sdk-php) 101 | * [AWS SDK for PHP website](http://aws.amazon.com/sdkforphp/) 102 | * [AWS on Packagist](https://packagist.org/packages/aws) 103 | * [License](http://aws.amazon.com/apache2.0/) 104 | * [Silex website](http://silex.sensiolabs.org) 105 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aws/aws-sdk-php-silex", 3 | "homepage": "http://aws.amazon.com/sdkforphp2", 4 | "description": "A simple Silex service provider for including the AWS SDK for PHP.", 5 | "keywords": ["silex","aws","amazon","sdk","s3","ec2","dynamodb"], 6 | "type":"library", 7 | "license":"Apache-2.0", 8 | "authors":[ 9 | { 10 | "name":"Amazon Web Services", 11 | "homepage":"http://aws.amazon.com" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=5.5", 16 | "aws/aws-sdk-php": "~3.0", 17 | "silex/silex": "^2.0" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "Aws\\Silex\\": "src/" 22 | } 23 | }, 24 | "autoload-dev": { 25 | "psr-4": { 26 | "Aws\\Silex\\": "tests/" 27 | } 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "3.0-dev" 32 | } 33 | }, 34 | "require-dev": { 35 | "phpunit/phpunit": "~4.7", 36 | "squizlabs/php_codesniffer": "^2.3" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ./tests 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/AwsServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 37 | 'Silex/' . Application::VERSION, 38 | 'SXMOD/' . self::VERSION, 39 | ]]); 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/AwsServiceProviderTest.php: -------------------------------------------------------------------------------- 1 | register($provider, array( 32 | 'aws.config' => array( 33 | 'version' => '2006-03-01', 34 | 'region' => 'us-east-1', 35 | 'credentials' => [ 36 | 'key' => 'fake-aws-key', 37 | 'secret' => 'fake-aws-secret', 38 | ], 39 | ) 40 | )); 41 | 42 | // Get an instance of a client (S3) to use for testing 43 | $s3 = $app['aws']->createS3(); 44 | 45 | // Verify that the app and clients created by the SDK receive the provided credentials 46 | $this->assertEquals('2006-03-01', $app['aws.config']['version']); 47 | $this->assertEquals('us-east-1', $app['aws.config']['region']); 48 | $this->assertEquals('2006-03-01', $s3->getApi()->getApiVersion()); 49 | $this->assertEquals('us-east-1', $s3->getRegion()); 50 | } 51 | 52 | /** 53 | * @expectedException \InvalidArgumentException 54 | */ 55 | public function testNoConfigProvided() 56 | { 57 | // Setup the Silex app and AWS service provider 58 | $app = new Application(); 59 | $provider = new AwsServiceProvider(); 60 | $app->register($provider, array( 61 | 'aws.config' => array( 62 | 'credentials' => [ 63 | 'key' => 'fake-aws-key', 64 | 'secret' => 'fake-aws-secret', 65 | ], 66 | ) 67 | )); 68 | 69 | // Instantiate a client, which should trigger an exception for missing configs 70 | $s3 = $app['aws']->createS3(); 71 | } 72 | } 73 | --------------------------------------------------------------------------------