1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Update libs

This commit is contained in:
Daniel Neto 2024-01-09 12:45:14 -03:00
parent 0e860cc473
commit f88b25c181
12716 changed files with 137183 additions and 39890 deletions

View file

@ -46,6 +46,7 @@
"amphp/amp": "^2.6", "amphp/amp": "^2.6",
"scssphp/scssphp": "^1.11", "scssphp/scssphp": "^1.11",
"vimeo/vimeo-api": "^3.0", "vimeo/vimeo-api": "^3.0",
"phpseclib/phpseclib": "^3.0" "phpseclib/phpseclib": "^3.0",
"bunnycdn/storage": "^2.0"
} }
} }

52
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "48bb318b21adcae713f23653ec2880c2", "content-hash": "fb3ed281e7175ec62060473352041473",
"packages": [ "packages": [
{ {
"name": "abraham/twitteroauth", "name": "abraham/twitteroauth",
@ -434,6 +434,54 @@
], ],
"time": "2021-08-15T20:50:18+00:00" "time": "2021-08-15T20:50:18+00:00"
}, },
{
"name": "bunnycdn/storage",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/BunnyWay/BunnyCDN.PHP.Storage.git",
"reference": "4f57caf033bca2255c1d75d369061902e2a32da5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/BunnyWay/BunnyCDN.PHP.Storage/zipball/4f57caf033bca2255c1d75d369061902e2a32da5",
"reference": "4f57caf033bca2255c1d75d369061902e2a32da5",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=8.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Bunny\\Storage\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dejan Grofelnik Pelzel",
"email": "dejan@bunnycdn.com"
}
],
"description": "PHP library to interact with the BunnyCDN Storage API.",
"homepage": "https://bunny.net/storage/",
"keywords": [
"Bunny.net",
"bunnyCDN",
"media",
"storage"
],
"support": {
"issues": "https://github.com/BunnyWay/BunnyCDN.PHP.Storage/issues",
"source": "https://github.com/BunnyWay/BunnyCDN.PHP.Storage/tree/2.0.0"
},
"time": "2023-12-14T13:40:23+00:00"
},
{ {
"name": "cboden/ratchet", "name": "cboden/ratchet",
"version": "v0.4.4", "version": "v0.4.4",
@ -6020,5 +6068,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.3" "php": "7.3"
}, },
"plugin-api-version": "2.6.0" "plugin-api-version": "2.3.0"
} }

View file

@ -0,0 +1,71 @@
<?php
$config = dirname(__FILE__) . '/../../../videos/configuration.php';
require_once $config;
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$cdnObj = AVideoPlugin::getDataObjectIfEnabled('CDN');
if (empty($cdnObj)) {
return die('Plugin disabled');
}
$_1hour = 3600;
$_2hours = $_1hour * 2;
ob_end_flush();
set_time_limit($_2hours);
ini_set('max_execution_time', $_2hours);
$parts = explode('.', $cdnObj->storage_hostname);
$apiAccessKey = readline("Enter BunnyCDN Storage API Access Key: ");
$storageZoneName = $cdnObj->storage_username; // Replace with your storage zone name
$storageZoneRegion = $parts[0]; // Replace with your storage zone region code
$client = new \Bunny\Storage\Client($apiAccessKey, $storageZoneName, $storageZoneRegion);
$sql = "SELECT * FROM videos WHERE 1=1 ORDER BY id $sort ";
$res = sqlDAL::readSql($sql, "", [], true);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
if ($res != false) {
$total = count($fullData);
foreach ($fullData as $key => $row) {
$info = "[{$total}, {$key}] ";
$videos_id = $row['id'];
$list = self::getFilesListBoth($videos_id);
foreach ($list as $value) {
if (empty($value['local'])) {
continue;
}
$filesize = filesize($value['local']['local_path']);
if ($value['isLocal'] && $filesize > 20) {
if (empty($value) || empty($value['remote']) || $filesize != $value['remote']['remote_filesize']) {
$remote_file = CDNStorage::filenameToRemotePath($value['local']['local_path']);
_error_log("CDNStorage::put {$value['local']['local_path']} {$remote_file} {$value['remote']['relative']}");
$client->upload($value['local']['local_path'], $remote_file);
} else {
_error_log("CDNStorage::put same size {$value['remote']['remote_filesize']} {$value['remote']['relative']}");
}
} else {
_error_log("CDNStorage::put not valid local file {$value['local']['local_path']}");
}
exit;
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
echo PHP_EOL . " Done! " . PHP_EOL;
//var_dump($transferStatus);
foreach ($statusSkipped as $key => $value) {
echo "Skipped {$key}: total={$value}" . PHP_EOL;
}
die();

View file

@ -1,58 +0,0 @@
---
Language: Cpp
# BasedOnStyle: Mozilla
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
ColumnLimit: 120
ContinuationIndentWidth: 4
DerivePointerAlignment: false
IncludeBlocks: Preserve
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 4
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 100000
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
...

View file

@ -1,4 +0,0 @@
# ignore generated files
ext/api.h
ext/*_arginfo.h
src/api.h

View file

@ -1,36 +0,0 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: bug, needs-triage
assignees: ''
---
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [ ] I've gone though [Developer Guide](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/welcome.html) and [API reference](http://sdk.amazonaws.com/cpp/api/LATEST/index.html)
- [ ] I've searched for [previous similar issues](https://github.com/aws/aws-sdk-cpp/issues) and didn't find any solution
**Describe the bug**
A clear and concise description of what the bug is.
**SDK version number**
**Platform/OS/Hardware/Device**
What are you running the sdk on?
**To Reproduce (observed behavior)**
Steps to reproduce the behavior (please share code)
**Expected behavior**
A clear and concise description of what you expected to happen.
**Logs/output**
If applicable, add logs or error output.
*REMEMBER TO SANITIZE YOUR PERSONAL INFO*
**Additional context**
Add any other context about the problem here.

View file

@ -1,20 +0,0 @@
---
name: "\U0001F680 Feature request"
about: Suggest an idea for this project
title: ''
labels: feature-request, needs-triage
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -1,23 +0,0 @@
---
name: "\U0001F4AC Questions / Help"
about: If you have questions, please check AWS Forums or StackOverflow
title: ''
labels: guidance, needs-triage
assignees: ''
---
Confirm by changing [ ] to [x] below:
- [ ] I've searched for [previous similar issues](https://github.com/awslabs/aws-crt-php/issues) and didn't find any solution
**Platform/OS/Hardware/Device**
What are you running the sdk on?
**Describe the question**
**Logs/output**
If applicable, add logs or error output.
*REMEMBER TO SANITIZE YOUR PERSONAL INFO*

View file

@ -1,6 +0,0 @@
*Issue #, if available:*
*Description of changes:*
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

View file

@ -1,156 +0,0 @@
name: CI
on:
push:
branches-ignore:
- 'main'
env:
BUILDER_VERSION: v0.8.18
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-php
LINUX_BASE_IMAGE: ubuntu-16-x64
RUN: ${{ github.run_id }}-${{ github.run_number }}
jobs:
php-5_5-linux-x64:
name: php-linux-x64 (5.5)
runs-on: ubuntu-latest
steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: 5.5
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install ancient PHPUnit
run: composer require --dev --ignore-platform-reqs phpunit/phpunit "4.8.36"
- name: Install dependencies
run: composer update --no-interaction
- name: Build for PHP 5.5
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
make
php-linux-x64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{matrix.version}}
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: composer update --no-interaction
- name: Run tests
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
make
make test
# linux-arm:
# name: ARM (${{ matrix.arch }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# arch: [armv6, armv7, arm64]
# steps:
# - name: Build ${{ env.PACKAGE_NAME }}
# run: |
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
# windows-vc16:
# runs-on: windows-latest
# strategy:
# matrix:
# arch: [x64]
# steps:
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: ${{ matrix.arch }}
# uwp: false
# spectre: true
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
# run: |
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
# windows-vc14:
# runs-on: windows-latest
# strategy:
# matrix:
# arch: [x86, x64]
# steps:
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# toolset: 14.0
# arch: ${{ matrix.arch }}
# uwp: false
# spectre: true
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
# run: |
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
macos:
runs-on: macos-${{ matrix.version }}
strategy:
matrix:
version: [10.15]
steps:
# Force PHP to 8.0
# Doing this because tests fail in PHP 8.1 (default on macos Github Runner as of Dec 2021)
# due to the old version of PHPUnit we're using.
# We're using an old PHPUnit because it's compatible our min supported PHP 5.5.
# Quick fix is to force PHP version back to 8.0, which can still run our tests without error.
# A real solution is to get our tests working on all PHP versions
# (maybe don't use PHPUnit, maybe raise our min supported PHP version so we can upgrade,
# or maybe use PHPUnit-Polyfills so we can use a modern PHPUnit with old PHP)
- name: Setup PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Build PHP 8 extension and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream

View file

@ -1,29 +0,0 @@
name: Lint
on: [push]
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v1
- name: clang-format lint
uses: DoozyX/clang-format-lint-action@v0.3.1
with:
# List of extensions to check
extensions: c
check-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Check Submodules
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main

View file

@ -1,46 +0,0 @@
name: "Close stale issues"
# Controls when the action will run.
on:
schedule:
- cron: "0 0 * * *"
jobs:
cleanup:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v3
with:
# Setting messages to an empty string will cause the automation to skip
# that category
ancient-issue-message: Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.
stale-issue-message: Greetings! It looks like this issue hasnt been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
stale-pr-message: Greetings! It looks like this PR hasnt been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
# These labels are required
stale-issue-label: closing-soon
exempt-issue-label: automation-exempt
stale-pr-label: closing-soon
exempt-pr-label: pr/needs-review
response-requested-label: response-requested
# Don't set closed-for-staleness label to skip closing very old issues
# regardless of label
closed-for-staleness-label: closed-for-staleness
# Issue timing
days-before-stale: 7
days-before-close: 4
days-before-ancient: 365
# If you don't want to mark a issue as being ancient based on a
# threshold of "upvotes", you can set this here. An "upvote" is
# the total number of +1, heart, hooray, and rocket reactions
# on an issue.
minimum-upvotes-to-exempt: 1
repo-token: ${{ secrets.GITHUB_TOKEN }}
loglevel: DEBUG
# Set dry-run to true to not perform label or close actions.
dry-run: false

View file

@ -1,210 +0,0 @@
# Created by https://www.toptal.com/developers/gitignore/api/autotools,cmake,phpstorm
# Edit at https://www.toptal.com/developers/gitignore?templates=autotools,cmake,phpstorm
### Autotools ###
# http://www.gnu.org/software/automake
Makefile.in
/ar-lib
/mdate-sh
/py-compile
/test-driver
/ylwrap
.deps/
# http://www.gnu.org/software/autoconf
autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.guess
/config.h.in
/config.log
/config.status
/config.sub
/configure
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1
# https://www.gnu.org/software/libtool/
/ltmain.sh
# http://www.gnu.org/software/texinfo
/texinfo.tex
# http://www.gnu.org/software/m4/
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
# Generated Makefile
# (meta build system like autotools,
# can automatically generate from config.status script
# (which is called by configure script))
Makefile
### Autotools Patch ###
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### CMake Patch ###
# External projects
*-prefix/
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### PhpStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
# End of https://www.toptal.com/developers/gitignore/api/autotools,cmake,phpstorm
.deps
.libs/
build/
configure.in
configure.ac
mkinstalldirs
run-tests.php
Makefile.global
acinclude.m4
libtool
modules/
*.lo
config.h
config.nice
*.la
Makefile*
!Makefile.am
!Makefile.frag
!Makefile.frag.w32
/vendor/
.idea/
.DS_Store
composer.lock
PHP-Parser*/
src/*.so
src/*.dylib
src/*.dll
# ignoring output of package.xml as it needs to be generated from ./prepare_release.sh in each publishing
package.xml
*.tgz

View file

@ -1,3 +0,0 @@
[submodule "crt/aws-crt-ffi"]
path = crt/aws-crt-ffi
url = https://github.com/awslabs/aws-crt-ffi.git

View file

@ -1,61 +0,0 @@
# Contributing Guidelines
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.
## Reporting Bugs/Feature Requests
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment
## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
1. You are working against the latest source on the *master* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
To send us a pull request, please:
1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.
## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
## Licensing
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

View file

@ -1,72 +0,0 @@
INT_DIR=build/install
GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1)
CMAKE = cmake3
ifeq (, $(shell which cmake3))
CMAKE = cmake
endif
# default to using system OpenSSL, if disabled aws-lc will be used
USE_OPENSSL ?= ON
ifneq (OFF,$(USE_OPENSSL))
CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON
# if a path was provided, add it to CMAKE_PREFIX_PATH
ifneq (ON,$(USE_OPENSSL))
CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL)
endif
endif
CMAKE_CONFIGURE = $(CMAKE) \
-DCMAKE_INSTALL_PREFIX=$(INT_DIR) \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
$(CMAKE_USE_OPENSSL) \
$(CMAKE_PREFIX_PATH)
CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build
CMAKE_BUILD_TYPE ?= RelWithDebInfo
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
all: extension
.PHONY: all extension
# configure for static aws-crt-ffi.a
build/aws-crt-ffi-static/CMakeCache.txt:
$(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi-static -DBUILD_SHARED_LIBS=OFF
# build static libaws-crt-ffi.a
build/aws-crt-ffi-static/libaws-crt-ffi.a: build/aws-crt-ffi-static/CMakeCache.txt
$(CMAKE_BUILD) build/aws-crt-ffi-static $(CMAKE_TARGET)
# PHP extension target
extension: ext/awscrt.lo
# Force the crt object target to depend on the CRT static library
ext/awscrt.lo: ext/awscrt.c
ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h
ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php
ifeq ($(GENERATE_STUBS),1)
# generate awscrt_arginfo.h
php gen_stub.php --minimal-arginfo ext/awscrt.stub.php
endif
# transform/install api.h from FFI lib
src/api.h: crt/aws-crt-ffi/src/api.h
php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h
# install api.h to ext/ as well
ext/api.h : src/api.h
cp -v src/api.h ext/api.h
ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h
vendor/bin/phpunit:
composer update
test-extension: vendor/bin/phpunit extension
composer run test-extension
# Use PHPUnit to run tests
test: test-extension

View file

@ -1,35 +0,0 @@
CMAKE=cmake.exe
COMPOSER_PHAR=C:\ProgramData\ComposerSetup\bin\composer.phar
PHP_BINARY=$(PHP_PREFIX)\php.exe
CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(AWSCRT_DIR)\build\install -DCMAKE_PREFIX_PATH=$(AWSCRT_DIR)\build\install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
CMAKE_BUILD = $(CMAKE) --build
CMAKE_BUILD_TYPE = Release
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
# configure for static aws-crt-ffi.lib
$(AWSCRT_DIR)\build\CMakeCache.txt:
$(CMAKE_CONFIGURE) -H$(AWSCRT_DIR)\crt\aws-crt-ffi -B$(AWSCRT_DIR)\build -DBUILD_SHARED_LIBS=OFF
# build static libaws-crt-ffi.lib
$(AWSCRT_DIR)\build\libaws-crt-ffi.lib: $(AWSCRT_DIR)\build\CMakeCache.txt
$(CMAKE_BUILD) $(AWSCRT_DIR)\build $(CMAKE_TARGET)
# Force the awscrt extension DLL target to depend on the extension src
$(BUILD_DIR)\php_awscrt.dll: $(AWSCRT_DIR)\ext\awscrt.c
$(AWSCRT_DIR)\ext\awscrt.c: $(AWSCRT_DIR)\build\libaws-crt-ffi.lib $(AWSCRT_DIR)\ext\api.h $(AWSCRT_DIR)\ext\awscrt_arginfo.h
# transform\install api.h from FFI lib
$(AWSCRT_DIR)\src\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h
php $(AWSCRT_DIR)\gen_api.php $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h > $(AWSCRT_DIR)\src\api.h
# install api.h to ext/ as well
$(AWSCRT_DIR)\ext\api.h : $(AWSCRT_DIR)\src\api.h
copy $(AWSCRT_DIR)\src\api.h $(AWSCRT_DIR)\ext\api.h
# Use PHPUnit to run tests
test-awscrt: install $(AWSCRT_DIR)\src\api.h $(BUILD_DIR)\php_awscrt.dll
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) update
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) run test-win

View file

@ -1,54 +1,76 @@
# AWS Common Runtime PHP bindings # AWS Common Runtime PHP bindings
## Requirements ## Requirements
* PHP 5.5+ on UNIX platforms, 7.2+ on Windows * PHP 5.5+ on UNIX platforms, 7.2+ on Windows
* CMake 3.x * CMake 3.x
* GCC 4.4+, clang 3.8+ on UNIX, Visual Studio 2017 build tools on Windows * GCC 4.4+, clang 3.8+ on UNIX, Visual Studio build tools on Windows
* Tests require [Composer](https://getcomposer.org) * Tests require [Composer](https://getcomposer.org)
## Building on UNIX ## Installing with Composer and PECL
The package has two different package published to [composer](https://packagist.org/packages/aws/aws-crt-php) and [PECL](https://pecl.php.net/package/awscrt).
On UNIX, you can get the package from package manager or build from source:
```
pecl install awscrt
composer require aws/aws-crt-php
```
On Windows, you need to build from source as instruction written below for the native extension `php_awscrt.dll` . And, follow https://www.php.net/manual/en/install.pecl.windows.php#install.pecl.windows.loading to load extension. After that:
```
composer require aws/aws-crt-php
```
## Building from Github source
```sh ```sh
$ git clone --recursive https://github.com/awslabs/aws-crt-php.git $ git clone --recursive https://github.com/awslabs/aws-crt-php.git
$ cd aws-crt-php $ cd aws-crt-php
$ phpize $ phpize
$ ./configure $ ./configure
$ make && make test $ make
$ ./dev-scripts/run_tests.sh
``` ```
## Building on Windows ## Building on Windows
* First, ensure that you are able to build PHP on windows via the PHP SDK (this example assumes installation of the SDK to C:\php-sdk and that you've checked out the PHP source to php-src within the build directory). The following resources are helpful to get PHP building on windows:
* https://github.com/microsoft/php-sdk-binary-tools ### Requirements for Windows
* https://medium.com/@erinus/how-to-build-php-on-windows-a7ad0a87862a
* https://medium.com/@erinus/how-to-build-php-extension-on-windows-d1667290f809 * Ensure you have the [windows PHP SDK](https://github.com/microsoft/php-sdk-binary-tools) (this example assumes installation of the SDK to C:\php-sdk and that you've checked out the PHP source to php-src within the build directory) and it works well on your machine.
* Ensure you have "Development package (SDK to develop PHP extensions)" and PHP available from your system path. You can download them from https://windows.php.net/download/. You can check if they are available by running `phpize -v` and `php -v`
### Instructions
From Command Prompt (not powershell). The instruction is based on Visual Studio 2019 on 64bit Windows.
```bat ```bat
""" From VS2017 Command Prompt > git clone --recursive https://github.com/awslabs/aws-crt-php.git
> C:\php-sdk\phpsdk-vc15-x64.bat > git clone https://github.com/microsoft/php-sdk-binary-tools.git C:\php-sdk
> C:\php-sdk\phpsdk-vs16-x64.bat
C:\php-sdk\ C:\php-sdk\
$ phpsdk_buildtree php-<version> $ cd <your-path-to-aws-crt-php>
C:\php-sdk\php-<version>\vc15\x64\ <your-path-to-aws-crt-php>\
$ git clone https://github.com/php/php-src.git && cd php-src $ phpize
""" This only has to be done once, the first time you set this all up # --with-prefix only required when your php runtime in system path is different than the runtime you wish to use.
C:\php-sdk\php-<version>\vc15\x64\php-src <your-path-to-aws-crt-php>\
$ phpsdk_deps --update --branch <php-major.minor-version> $ configure --enable-awscrt=shared --with-prefix=<your-path-to-php-prefix>
C:\php-sdk\php-<version>\vc15\x64\php-src <your-path-to-aws-crt-php>\
$ git clone --recursive https://github.com/awslabs/aws-crt-php.git ..\pecl\awscrt
C:\php-sdk\php-<version>\vc15\x64\php-src
$ buildconf
C:\php-sdk\php-<version>\vc15\x64\php-src
$ configure --enable-cli --with-openssl --enable-awscrt=shared
C:\php-sdk\php-<version>\vc15\x64\php-src
$ nmake $ nmake
C:\php-sdk\php-<version>\vc15\x64\php-src <your-path-to-aws-crt-php>\
$ nmake test-awscrt $ nmake generate-php-ini
# check .\php-win.ini, it now has the full path to php_awscrt.dll that you can manually load to your php runtime, or you can run the following command to run tests and load the required native extension for awscrt.
<your-path-to-aws-crt-php>\
$ .\dev-scripts\run_tests.bat <your-path-to-php-binary>
``` ```
Note: for VS2017, Cmake will default to build for Win32, refer to [here](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html). If you are building for x64 php, you can set environment variable as follow to let cmake pick x64 compiler. Note: for VS2017, Cmake will default to build for Win32, refer to [here](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html). If you are building for x64 php, you can set environment variable as follow to let cmake pick x64 compiler.
@ -59,6 +81,7 @@ set CMAKE_GENERATOR_PLATFORM=x64
``` ```
## Debugging ## Debugging
Using [PHPBrew](https://github.com/phpbrew/phpbrew) to build/manage multiple versions of PHP is helpful. Using [PHPBrew](https://github.com/phpbrew/phpbrew) to build/manage multiple versions of PHP is helpful.
Note: You must use a debug build of PHP to debug native extensions. Note: You must use a debug build of PHP to debug native extensions.
@ -75,13 +98,20 @@ $ ./configure
$ make CMAKE_BUILD_TYPE=Debug $ make CMAKE_BUILD_TYPE=Debug
``` ```
Ensure that the php you launch from your debugger is the result of `which php`, not just Ensure that the php you launch from your debugger is the result of `which php` , not just
the system default php. the system default php.
## Security ## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## Known OpenSSL related issue (Unix only)
* When your php loads a different version of openssl than your system openssl version, awscrt may fail to load or weirdly crash. You can find the openssl version php linked via: `php -i | grep 'OpenSSL'`, and awscrt linked from the build log, which will be `Found OpenSSL: * (found version *)`
The easiest workaround to those issue is to build from source and get aws-lc for awscrt to depend on instead.
TO do that, same instructions as [here](#building-from-github-source), but use `USE_OPENSSL=OFF make` instead of `make`
## License ## License
This project is licensed under the Apache-2.0 License. This project is licensed under the Apache-2.0 License.

View file

@ -1,37 +0,0 @@
{
"name": "aws-crt-php",
"hosts": {
"ubuntu": {
"pkg_setup": [
"add-apt-repository -y ppa:ondrej/php"
],
"packages": [
"autotools-dev",
"autoconf",
"libtool",
"clang",
"php5.6-dev"
]
},
"al2": {
"packages": [
"autoconf",
"automake",
"libtool",
"clang",
"php-devel"
]
}
},
"build_steps": [
["phpize"],
["./configure"],
["make"]
],
"test_env": {
"NO_INTERACTION": "1"
},
"test_steps": [
["./run_tests"]
]
}

View file

@ -1,6 +1,6 @@
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
"homepage": "http://aws.amazon.com/sdkforphp", "homepage": "https://github.com/awslabs/aws-crt-php",
"description": "AWS Common Runtime for PHP", "description": "AWS Common Runtime for PHP",
"keywords": ["aws","amazon","sdk","crt"], "keywords": ["aws","amazon","sdk","crt"],
"type": "library", "type": "library",
@ -10,25 +10,26 @@
"email": "aws-sdk-common-runtime@amazon.com" "email": "aws-sdk-common-runtime@amazon.com"
} }
], ],
"config": {
"platform": {"php": "5.6"}
},
"minimum-stability": "alpha", "minimum-stability": "alpha",
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit":"^4.8.35|^5.6.3" "phpunit/phpunit":"^4.8.35||^5.6.3||^9.5",
"yoast/phpunit-polyfills": "^1.0"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
"src/" "src/"
] ]
}, },
"suggest": {
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
},
"scripts": { "scripts": {
"test": "./run_tests", "test": "./dev-scripts/run_tests.sh",
"test-extension": "@test", "test-extension": "@test",
"test-win": "run_tests" "test-win": ".\\dev-scripts\\run_tests.bat"
}, },
"license": "Apache-2.0" "license": "Apache-2.0"
} }

View file

@ -1,30 +0,0 @@
dnl
dnl * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
dnl * SPDX-License-Identifier: Apache-2.0.
dnl
PHP_ARG_WITH(awscrt, for AWS Common Runtime support,
[ --with-awscrt Include awscrt support])
if test "$PHP_AWSCRT" != "no"; then
# force lib paths to be absolute, or PHP will mangle them
cwd=`pwd`
# Enable s2n and libcrypto for non-darwin UNIX
if uname -a | grep -i darwin > /dev/null 2>&1; then
platform_tls_libs=""
else
platform_tls_libs="-ls2n -lcrypto"
fi
CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64"
CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}"
PHP_ADD_INCLUDE(${cwd}/build/install/include)
PHP_EVAL_LIBLINE([$CRT_LIBPATHS $CRT_LIBS], AWSCRT_SHARED_LIBADD)
# Shoves the linker line into the Makefile
PHP_SUBST(AWSCRT_SHARED_LIBADD)
# Sources for the PHP extension itself
AWSCRT_SOURCES=ext/awscrt.c
PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared)
PHP_ADD_MAKEFILE_FRAGMENT
fi

View file

@ -1,13 +0,0 @@
// vim:ft=javascript
ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes");
if (PHP_AWSCRT != "no") {
ADD_MAKEFILE_FRAGMENT();
DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include');
DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' +
'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-checksums.lib aws-c-common.lib ' +
'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib');
DEFINE('AWSCRT_DIR', configure_module_dirname);
EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED);
}

View file

@ -1,2 +0,0 @@
*.so
api.h

View file

@ -1,17 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/* This is a unity-build style source file, as PHP's build system is simplest with 1 source file per extension */
#include "credentials.c"
#include "crt.c"
#include "event_loop.c"
#include "http.c"
#include "signing.c"
#include "stream.c"
// #include "hash.c"
#include "crc.c"
#include "logging.c"
#include "php_util.c"

View file

@ -1,88 +0,0 @@
<?php
/**
* @generate-class-entries
* @generate-function-entries
*/
function aws_crt_last_error(): int {}
function aws_crt_error_name(int $error_code): string {}
function aws_crt_error_str(int $error_code): string {}
function aws_crt_error_debug_str(int $error_code): string {}
function aws_crt_log_to_stdout(): void {}
function aws_crt_log_to_stderr(): void {}
function aws_crt_log_to_file(string $filename): void {}
function aws_crt_log_to_stream(object $stream): void {}
function aws_crt_log_stop(): void {}
function aws_crt_log_set_level(int $level): void {}
function aws_crt_log_message(string $message): void {}
function aws_crt_event_loop_group_options_new(): int {}
function aws_crt_event_loop_group_options_release(int $elg_options): void {}
function aws_crt_event_loop_group_options_set_max_threads(int $elg_options, int $max_threads): void {}
function aws_crt_event_loop_group_new(object $options): object {}
function aws_crt_event_loop_group_release(object $event_loop_group): void {}
function aws_crt_input_stream_options_new(): object {}
function aws_crt_input_stream_options_release(object $options): void {}
function aws_crt_input_stream_options_set_user_data(object $options, object $user_data): void {}
function aws_crt_input_stream_new(object $options): object {}
function aws_crt_input_stream_release(int $stream): void {}
function aws_crt_input_stream_seek(int $stream, int $offset, int $basis): int {}
function aws_crt_input_stream_read(int $stream, int $length): string {}
function aws_crt_input_stream_eof(int $stream): bool {}
function aws_crt_input_stream_get_length(int $stream): int {}
function aws_crt_http_message_new_from_blob(string $blob): int {}
function aws_crt_http_message_to_blob(int $message): string {}
function aws_crt_http_message_release(int $message): void {}
function aws_crt_credentials_options_new(): object {}
function aws_crt_credentials_options_release(object $options): void {}
function aws_crt_credentials_options_set_access_key_id(object $options, string $access_key_id): void {}
function aws_crt_credentials_options_set_secret_access_key(object $options, string $secret_access_key): void {}
function aws_crt_credentials_options_set_session_token(object $options, string $session_token): void {}
function aws_crt_credentials_options_set_expiration_timepoint_seconds(object $options, int $expiration_timepoint_seconds): void {}
function aws_crt_credentials_new(object $options): object {}
function aws_crt_credentials_release(object $credentials): void {}
function aws_crt_credentials_provider_release(int $credentials): void {}
function aws_crt_credentials_provider_static_options_new(): object {}
function aws_crt_credentials_provider_static_options_release(object $options): void {}
function aws_crt_credentials_provider_static_options_set_access_key_id(object $options, string $access_key_id): void {}
function aws_crt_credentials_provider_static_options_set_secret_access_key(object $options, string $secret_access_key): void {}
function aws_crt_credentials_provider_static_options_set_session_token(object $options, string $session_token): void {}
function aws_crt_credentials_provider_static_new(object $options): object {}
function aws_crt_signing_config_aws_new(): int {}
function aws_crt_signing_config_aws_release(int $config): void {}
function aws_crt_signing_config_aws_set_algorithm(int $config, int $algorithm): void {}
function aws_crt_signing_config_aws_set_signature_type(int $config, int $signature_type): void {}
function aws_crt_signing_config_aws_set_credentials_provider(int $config, int $credentials_provider): void {}
function aws_crt_signing_config_aws_set_region(int $config, string $region): void {}
function aws_crt_signing_config_aws_set_service(int $config, string $service): void {}
function aws_crt_signing_config_aws_set_use_double_uri_encode(int $config, bool $use_double_uri_encode): void {}
function aws_crt_signing_config_aws_set_should_normalize_uri_path(int $config, bool $should_normalize_uri_path): void {}
function aws_crt_signing_config_aws_set_omit_session_token(int $config, bool $omit_session_token): void {}
function aws_crt_signing_config_aws_set_signed_body_value(int $config, string $signed_body_value): void {}
function aws_crt_signing_config_aws_set_signed_body_header_type(int $config, int $signed_body_header_type): void {}
function aws_crt_signing_config_aws_set_expiration_in_seconds(int $config, int $expiration_in_seconds): void {}
function aws_crt_signing_config_aws_set_date(int $config, int $timestamp): void {}
function aws_crt_signing_config_aws_set_should_sign_header_fn(int $config, object $should_sign_header): void {}
function aws_crt_signable_new_from_http_request(int $http_message): int {}
function aws_crt_signable_new_from_chunk(int $input_stream, string $previous_signature): int {}
function aws_crt_signable_new_from_canonical_request(string $request): int {}
function aws_crt_signable_release(int $signable): void {}
function aws_crt_signing_result_release(int $signing_result): void {}
function aws_crt_signing_result_apply_to_http_request(object $signing_result, object $http_request): void {}
function aws_crt_sign_request_aws(int $signable, int $signing_config, object $on_complete, object $user_data): int {}
function aws_crt_test_verify_sigv4a_signing(int $signable, int $signing_config, string $expected_canonical_request, string $signature, string $ecc_key_pub_x, string $ecc_key_pub_y): bool {}
function aws_crt_crc32(string $input, int $prev): int {}
function aws_crt_crc32c(string $input, int $prev): int {}

View file

@ -1,413 +0,0 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 344f9d59b85697b80bb6808ac7d5eb7c1d07c03f */
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_last_error, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_error_name, 0, 0, 1)
ZEND_ARG_INFO(0, error_code)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_error_str arginfo_aws_crt_error_name
#define arginfo_aws_crt_error_debug_str arginfo_aws_crt_error_name
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stdout, 0, 0, 0)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_log_to_stderr arginfo_aws_crt_log_to_stdout
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_file, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stream, 0, 0, 1)
ZEND_ARG_INFO(0, stream)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_log_stop arginfo_aws_crt_log_to_stdout
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_set_level, 0, 0, 1)
ZEND_ARG_INFO(0, level)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_message, 0, 0, 1)
ZEND_ARG_INFO(0, message)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_event_loop_group_options_new arginfo_aws_crt_last_error
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_release, 0, 0, 1)
ZEND_ARG_INFO(0, elg_options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_set_max_threads, 0, 0, 2)
ZEND_ARG_INFO(0, elg_options)
ZEND_ARG_INFO(0, max_threads)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_new, 0, 0, 1)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_release, 0, 0, 1)
ZEND_ARG_INFO(0, event_loop_group)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_new, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_release, 0, 0, 1)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_set_user_data, 0, 0, 2)
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, user_data)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_input_stream_new arginfo_aws_crt_event_loop_group_new
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_release, 0, 0, 1)
ZEND_ARG_INFO(0, stream)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_seek, 0, 0, 3)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, basis)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_read, 0, 0, 2)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_INFO(0, length)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_eof, 0, 0, 1)
ZEND_ARG_INFO(0, stream)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_get_length, 0, 0, 1)
ZEND_ARG_INFO(0, stream)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_new_from_blob, 0, 0, 1)
ZEND_ARG_INFO(0, blob)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_to_blob, 0, 0, 1)
ZEND_ARG_INFO(0, message)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_release, 0, 0, 1)
ZEND_ARG_INFO(0, message)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_credentials_options_new arginfo_aws_crt_input_stream_options_new
#define arginfo_aws_crt_credentials_options_release arginfo_aws_crt_input_stream_options_release
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_access_key_id, 0, 0, 2)
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, access_key_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_secret_access_key, 0, 0, 2)
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, secret_access_key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_session_token, 0, 0, 2)
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, session_token)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds, 0, 0, 2)
ZEND_ARG_INFO(0, options)
ZEND_ARG_INFO(0, expiration_timepoint_seconds)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_credentials_new arginfo_aws_crt_event_loop_group_new
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_release, 0, 0, 1)
ZEND_ARG_INFO(0, credentials)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_provider_release, 0, 0, 1)
ZEND_ARG_INFO(0, credentials)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_credentials_provider_static_options_new arginfo_aws_crt_input_stream_options_new
#define arginfo_aws_crt_credentials_provider_static_options_release arginfo_aws_crt_input_stream_options_release
#define arginfo_aws_crt_credentials_provider_static_options_set_access_key_id arginfo_aws_crt_credentials_options_set_access_key_id
#define arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key arginfo_aws_crt_credentials_options_set_secret_access_key
#define arginfo_aws_crt_credentials_provider_static_options_set_session_token arginfo_aws_crt_credentials_options_set_session_token
#define arginfo_aws_crt_credentials_provider_static_new arginfo_aws_crt_event_loop_group_new
#define arginfo_aws_crt_signing_config_aws_new arginfo_aws_crt_last_error
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_release, 0, 0, 1)
ZEND_ARG_INFO(0, config)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_algorithm, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, algorithm)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signature_type, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, signature_type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_credentials_provider, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, credentials_provider)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_region, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, region)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_service, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, service)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, use_double_uri_encode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, should_normalize_uri_path)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_omit_session_token, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, omit_session_token)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_value, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, signed_body_value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_header_type, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, signed_body_header_type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, expiration_in_seconds)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_date, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, timestamp)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn, 0, 0, 2)
ZEND_ARG_INFO(0, config)
ZEND_ARG_INFO(0, should_sign_header)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_http_request, 0, 0, 1)
ZEND_ARG_INFO(0, http_message)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_chunk, 0, 0, 2)
ZEND_ARG_INFO(0, input_stream)
ZEND_ARG_INFO(0, previous_signature)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_canonical_request, 0, 0, 1)
ZEND_ARG_INFO(0, request)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_release, 0, 0, 1)
ZEND_ARG_INFO(0, signable)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_release, 0, 0, 1)
ZEND_ARG_INFO(0, signing_result)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_apply_to_http_request, 0, 0, 2)
ZEND_ARG_INFO(0, signing_result)
ZEND_ARG_INFO(0, http_request)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_sign_request_aws, 0, 0, 4)
ZEND_ARG_INFO(0, signable)
ZEND_ARG_INFO(0, signing_config)
ZEND_ARG_INFO(0, on_complete)
ZEND_ARG_INFO(0, user_data)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_test_verify_sigv4a_signing, 0, 0, 6)
ZEND_ARG_INFO(0, signable)
ZEND_ARG_INFO(0, signing_config)
ZEND_ARG_INFO(0, expected_canonical_request)
ZEND_ARG_INFO(0, signature)
ZEND_ARG_INFO(0, ecc_key_pub_x)
ZEND_ARG_INFO(0, ecc_key_pub_y)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_crc32, 0, 0, 2)
ZEND_ARG_INFO(0, input)
ZEND_ARG_INFO(0, prev)
ZEND_END_ARG_INFO()
#define arginfo_aws_crt_crc32c arginfo_aws_crt_crc32
ZEND_FUNCTION(aws_crt_last_error);
ZEND_FUNCTION(aws_crt_error_name);
ZEND_FUNCTION(aws_crt_error_str);
ZEND_FUNCTION(aws_crt_error_debug_str);
ZEND_FUNCTION(aws_crt_log_to_stdout);
ZEND_FUNCTION(aws_crt_log_to_stderr);
ZEND_FUNCTION(aws_crt_log_to_file);
ZEND_FUNCTION(aws_crt_log_to_stream);
ZEND_FUNCTION(aws_crt_log_stop);
ZEND_FUNCTION(aws_crt_log_set_level);
ZEND_FUNCTION(aws_crt_log_message);
ZEND_FUNCTION(aws_crt_event_loop_group_options_new);
ZEND_FUNCTION(aws_crt_event_loop_group_options_release);
ZEND_FUNCTION(aws_crt_event_loop_group_options_set_max_threads);
ZEND_FUNCTION(aws_crt_event_loop_group_new);
ZEND_FUNCTION(aws_crt_event_loop_group_release);
ZEND_FUNCTION(aws_crt_input_stream_options_new);
ZEND_FUNCTION(aws_crt_input_stream_options_release);
ZEND_FUNCTION(aws_crt_input_stream_options_set_user_data);
ZEND_FUNCTION(aws_crt_input_stream_new);
ZEND_FUNCTION(aws_crt_input_stream_release);
ZEND_FUNCTION(aws_crt_input_stream_seek);
ZEND_FUNCTION(aws_crt_input_stream_read);
ZEND_FUNCTION(aws_crt_input_stream_eof);
ZEND_FUNCTION(aws_crt_input_stream_get_length);
ZEND_FUNCTION(aws_crt_http_message_new_from_blob);
ZEND_FUNCTION(aws_crt_http_message_to_blob);
ZEND_FUNCTION(aws_crt_http_message_release);
ZEND_FUNCTION(aws_crt_credentials_options_new);
ZEND_FUNCTION(aws_crt_credentials_options_release);
ZEND_FUNCTION(aws_crt_credentials_options_set_access_key_id);
ZEND_FUNCTION(aws_crt_credentials_options_set_secret_access_key);
ZEND_FUNCTION(aws_crt_credentials_options_set_session_token);
ZEND_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds);
ZEND_FUNCTION(aws_crt_credentials_new);
ZEND_FUNCTION(aws_crt_credentials_release);
ZEND_FUNCTION(aws_crt_credentials_provider_release);
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_new);
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_release);
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id);
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key);
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token);
ZEND_FUNCTION(aws_crt_credentials_provider_static_new);
ZEND_FUNCTION(aws_crt_signing_config_aws_new);
ZEND_FUNCTION(aws_crt_signing_config_aws_release);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_algorithm);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signature_type);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_region);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_service);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_date);
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn);
ZEND_FUNCTION(aws_crt_signable_new_from_http_request);
ZEND_FUNCTION(aws_crt_signable_new_from_chunk);
ZEND_FUNCTION(aws_crt_signable_new_from_canonical_request);
ZEND_FUNCTION(aws_crt_signable_release);
ZEND_FUNCTION(aws_crt_signing_result_release);
ZEND_FUNCTION(aws_crt_signing_result_apply_to_http_request);
ZEND_FUNCTION(aws_crt_sign_request_aws);
ZEND_FUNCTION(aws_crt_test_verify_sigv4a_signing);
ZEND_FUNCTION(aws_crt_crc32);
ZEND_FUNCTION(aws_crt_crc32c);
static const zend_function_entry ext_functions[] = {
ZEND_FE(aws_crt_last_error, arginfo_aws_crt_last_error)
ZEND_FE(aws_crt_error_name, arginfo_aws_crt_error_name)
ZEND_FE(aws_crt_error_str, arginfo_aws_crt_error_str)
ZEND_FE(aws_crt_error_debug_str, arginfo_aws_crt_error_debug_str)
ZEND_FE(aws_crt_log_to_stdout, arginfo_aws_crt_log_to_stdout)
ZEND_FE(aws_crt_log_to_stderr, arginfo_aws_crt_log_to_stderr)
ZEND_FE(aws_crt_log_to_file, arginfo_aws_crt_log_to_file)
ZEND_FE(aws_crt_log_to_stream, arginfo_aws_crt_log_to_stream)
ZEND_FE(aws_crt_log_stop, arginfo_aws_crt_log_stop)
ZEND_FE(aws_crt_log_set_level, arginfo_aws_crt_log_set_level)
ZEND_FE(aws_crt_log_message, arginfo_aws_crt_log_message)
ZEND_FE(aws_crt_event_loop_group_options_new, arginfo_aws_crt_event_loop_group_options_new)
ZEND_FE(aws_crt_event_loop_group_options_release, arginfo_aws_crt_event_loop_group_options_release)
ZEND_FE(aws_crt_event_loop_group_options_set_max_threads, arginfo_aws_crt_event_loop_group_options_set_max_threads)
ZEND_FE(aws_crt_event_loop_group_new, arginfo_aws_crt_event_loop_group_new)
ZEND_FE(aws_crt_event_loop_group_release, arginfo_aws_crt_event_loop_group_release)
ZEND_FE(aws_crt_input_stream_options_new, arginfo_aws_crt_input_stream_options_new)
ZEND_FE(aws_crt_input_stream_options_release, arginfo_aws_crt_input_stream_options_release)
ZEND_FE(aws_crt_input_stream_options_set_user_data, arginfo_aws_crt_input_stream_options_set_user_data)
ZEND_FE(aws_crt_input_stream_new, arginfo_aws_crt_input_stream_new)
ZEND_FE(aws_crt_input_stream_release, arginfo_aws_crt_input_stream_release)
ZEND_FE(aws_crt_input_stream_seek, arginfo_aws_crt_input_stream_seek)
ZEND_FE(aws_crt_input_stream_read, arginfo_aws_crt_input_stream_read)
ZEND_FE(aws_crt_input_stream_eof, arginfo_aws_crt_input_stream_eof)
ZEND_FE(aws_crt_input_stream_get_length, arginfo_aws_crt_input_stream_get_length)
ZEND_FE(aws_crt_http_message_new_from_blob, arginfo_aws_crt_http_message_new_from_blob)
ZEND_FE(aws_crt_http_message_to_blob, arginfo_aws_crt_http_message_to_blob)
ZEND_FE(aws_crt_http_message_release, arginfo_aws_crt_http_message_release)
ZEND_FE(aws_crt_credentials_options_new, arginfo_aws_crt_credentials_options_new)
ZEND_FE(aws_crt_credentials_options_release, arginfo_aws_crt_credentials_options_release)
ZEND_FE(aws_crt_credentials_options_set_access_key_id, arginfo_aws_crt_credentials_options_set_access_key_id)
ZEND_FE(aws_crt_credentials_options_set_secret_access_key, arginfo_aws_crt_credentials_options_set_secret_access_key)
ZEND_FE(aws_crt_credentials_options_set_session_token, arginfo_aws_crt_credentials_options_set_session_token)
ZEND_FE(aws_crt_credentials_options_set_expiration_timepoint_seconds, arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds)
ZEND_FE(aws_crt_credentials_new, arginfo_aws_crt_credentials_new)
ZEND_FE(aws_crt_credentials_release, arginfo_aws_crt_credentials_release)
ZEND_FE(aws_crt_credentials_provider_release, arginfo_aws_crt_credentials_provider_release)
ZEND_FE(aws_crt_credentials_provider_static_options_new, arginfo_aws_crt_credentials_provider_static_options_new)
ZEND_FE(aws_crt_credentials_provider_static_options_release, arginfo_aws_crt_credentials_provider_static_options_release)
ZEND_FE(aws_crt_credentials_provider_static_options_set_access_key_id, arginfo_aws_crt_credentials_provider_static_options_set_access_key_id)
ZEND_FE(aws_crt_credentials_provider_static_options_set_secret_access_key, arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key)
ZEND_FE(aws_crt_credentials_provider_static_options_set_session_token, arginfo_aws_crt_credentials_provider_static_options_set_session_token)
ZEND_FE(aws_crt_credentials_provider_static_new, arginfo_aws_crt_credentials_provider_static_new)
ZEND_FE(aws_crt_signing_config_aws_new, arginfo_aws_crt_signing_config_aws_new)
ZEND_FE(aws_crt_signing_config_aws_release, arginfo_aws_crt_signing_config_aws_release)
ZEND_FE(aws_crt_signing_config_aws_set_algorithm, arginfo_aws_crt_signing_config_aws_set_algorithm)
ZEND_FE(aws_crt_signing_config_aws_set_signature_type, arginfo_aws_crt_signing_config_aws_set_signature_type)
ZEND_FE(aws_crt_signing_config_aws_set_credentials_provider, arginfo_aws_crt_signing_config_aws_set_credentials_provider)
ZEND_FE(aws_crt_signing_config_aws_set_region, arginfo_aws_crt_signing_config_aws_set_region)
ZEND_FE(aws_crt_signing_config_aws_set_service, arginfo_aws_crt_signing_config_aws_set_service)
ZEND_FE(aws_crt_signing_config_aws_set_use_double_uri_encode, arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode)
ZEND_FE(aws_crt_signing_config_aws_set_should_normalize_uri_path, arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path)
ZEND_FE(aws_crt_signing_config_aws_set_omit_session_token, arginfo_aws_crt_signing_config_aws_set_omit_session_token)
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_value, arginfo_aws_crt_signing_config_aws_set_signed_body_value)
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_header_type, arginfo_aws_crt_signing_config_aws_set_signed_body_header_type)
ZEND_FE(aws_crt_signing_config_aws_set_expiration_in_seconds, arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds)
ZEND_FE(aws_crt_signing_config_aws_set_date, arginfo_aws_crt_signing_config_aws_set_date)
ZEND_FE(aws_crt_signing_config_aws_set_should_sign_header_fn, arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn)
ZEND_FE(aws_crt_signable_new_from_http_request, arginfo_aws_crt_signable_new_from_http_request)
ZEND_FE(aws_crt_signable_new_from_chunk, arginfo_aws_crt_signable_new_from_chunk)
ZEND_FE(aws_crt_signable_new_from_canonical_request, arginfo_aws_crt_signable_new_from_canonical_request)
ZEND_FE(aws_crt_signable_release, arginfo_aws_crt_signable_release)
ZEND_FE(aws_crt_signing_result_release, arginfo_aws_crt_signing_result_release)
ZEND_FE(aws_crt_signing_result_apply_to_http_request, arginfo_aws_crt_signing_result_apply_to_http_request)
ZEND_FE(aws_crt_sign_request_aws, arginfo_aws_crt_sign_request_aws)
ZEND_FE(aws_crt_test_verify_sigv4a_signing, arginfo_aws_crt_test_verify_sigv4a_signing)
ZEND_FE(aws_crt_crc32, arginfo_aws_crt_crc32)
ZEND_FE(aws_crt_crc32c, arginfo_aws_crt_crc32c)
ZEND_FE_END
};

View file

@ -1,32 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_crc32) {
zend_ulong prev = 0;
const char *input = NULL;
size_t len = 0;
aws_php_parse_parameters("sl", &input, &len, &prev);
if (prev > UINT32_MAX) {
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
}
RETURN_LONG((zend_ulong)aws_crt_crc32((const uint8_t *)input, len, prev));
}
PHP_FUNCTION(aws_crt_crc32c) {
zend_ulong prev = 0;
const char *input = NULL;
size_t len = 0;
aws_php_parse_parameters("sl", &input, &len, &prev);
if (prev > UINT32_MAX) {
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
}
RETURN_LONG((zend_ulong)aws_crt_crc32c((const uint8_t *)input, len, prev));
}

View file

@ -1,154 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_credentials_options_new) {
aws_crt_credentials_options *options = aws_crt_credentials_options_new();
RETURN_LONG((zend_ulong)options);
}
PHP_FUNCTION(aws_crt_credentials_options_release) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials_options_release(options);
}
PHP_FUNCTION(aws_crt_credentials_options_set_access_key_id) {
zend_ulong php_options = 0;
const char *access_key_id = NULL;
size_t access_key_id_len = 0;
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
}
PHP_FUNCTION(aws_crt_credentials_options_set_secret_access_key) {
zend_ulong php_options = 0;
const char *secret_access_key = NULL;
size_t secret_access_key_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
FAILURE) {
RETURN_NULL();
}
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials_options_set_secret_access_key(options, (uint8_t *)secret_access_key, secret_access_key_len);
}
PHP_FUNCTION(aws_crt_credentials_options_set_session_token) {
zend_ulong php_options = 0;
const char *session_token = NULL;
size_t session_token_len = 0;
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
}
PHP_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds) {
zend_ulong php_options = 0;
zend_ulong expiration_timepoint_seconds = 0;
aws_php_parse_parameters("ll", &php_options, &expiration_timepoint_seconds);
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials_options_set_expiration_timepoint_seconds(options, expiration_timepoint_seconds);
}
PHP_FUNCTION(aws_crt_credentials_new) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_credentials_options *options = (void *)php_options;
aws_crt_credentials *credentials = aws_crt_credentials_new(options);
RETURN_LONG((zend_ulong)credentials);
}
PHP_FUNCTION(aws_crt_credentials_release) {
zend_ulong php_credentials = 0;
aws_php_parse_parameters("l", &php_credentials);
aws_crt_credentials *credentials = (void *)php_credentials;
aws_crt_credentials_release(credentials);
}
PHP_FUNCTION(aws_crt_credentials_provider_release) {
zend_ulong php_creds_provider = 0;
aws_php_parse_parameters("l", &php_creds_provider);
aws_crt_credentials_provider *provider = (void *)php_creds_provider;
aws_crt_credentials_provider_release(provider);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_options_new) {
aws_crt_credentials_provider_static_options *options = aws_crt_credentials_provider_static_options_new();
RETURN_LONG((zend_ulong)options);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_options_release) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_credentials_provider_static_options *options = (void *)php_options;
aws_crt_credentials_provider_static_options_release(options);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id) {
zend_ulong php_options = 0;
const char *access_key_id = NULL;
size_t access_key_id_len = 0;
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
aws_crt_credentials_provider_static_options *options = (void *)php_options;
aws_crt_credentials_provider_static_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key) {
zend_ulong php_options = 0;
const char *secret_access_key = NULL;
size_t secret_access_key_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
FAILURE) {
RETURN_NULL();
}
aws_crt_credentials_provider_static_options *options = (void *)php_options;
aws_crt_credentials_provider_static_options_set_secret_access_key(
options, (uint8_t *)secret_access_key, secret_access_key_len);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token) {
zend_ulong php_options = 0;
const char *session_token = NULL;
size_t session_token_len = 0;
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
aws_crt_credentials_provider_static_options *options = (void *)php_options;
aws_crt_credentials_provider_static_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
}
PHP_FUNCTION(aws_crt_credentials_provider_static_new) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_credentials_provider_static_options *options = (void *)php_options;
aws_crt_credentials_provider *provider = aws_crt_credentials_provider_static_new(options);
RETURN_LONG((zend_ulong)provider);
}

View file

@ -1,314 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
/* Helpful references for this extension:
* zend_parse_parameters and friends -
* https://git.php.net/?p=php-src.git;a=blob;f=docs/parameter-parsing-api.md;h=c962fc6ee58cc756aaac9e65759b7d5ea5c18fc4;hb=HEAD
* https://git.php.net/?p=php-src.git;a=blob;f=docs/self-contained-extensions.md;h=47f4c636baca8ca195118e2cc234ac7fd2842c1b;hb=HEAD
* Threads:
* http://blog.jpauli.tech/2017-01-12-threads-and-php-html/
* Examples:
* Curl extension: https://github.com/php/php-src/blob/PHP-5.6/ext/curl/interface.c
* libuv extension: https://github.com/amphp/ext-uv/blob/master/php_uv.c
*/
zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...) {
char *error = NULL;
zend_fcall_info fci = {0};
zend_fcall_info_cache fcc = empty_fcall_info_cache;
if (zend_fcall_info_init(callback, IS_CALLABLE_CHECK_SYNTAX_ONLY, &fci, &fcc, NULL, &error) == FAILURE) {
aws_php_throw_exception("Unable to initialize callback from callable via zend_fcall_info_init: %s", error);
}
/* Allocate the stack frame of zval arguments and fill them in */
const size_t num_args = strlen(arg_types);
zval *stack = alloca(sizeof(zval) * num_args);
int arg_idx = 0;
va_list va;
va_start(va, arg_types);
while (arg_idx < num_args) {
const char arg_type = arg_types[arg_idx];
switch (arg_type) {
/* zval types */
case 'a':
case 'A':
case 'n':
case 'o':
case 'r':
case 'z': {
zval *zval_val = va_arg(va, zval *);
ZVAL_ZVAL(&stack[arg_idx], zval_val, 0, 0);
break;
}
/* buffers/strings (char *, size_t) */
case 'p':
case 's': {
const char *buf = va_arg(va, const char *);
const size_t len = va_arg(va, size_t);
aws_php_zval_stringl(&stack[arg_idx], buf, len);
break;
}
/* other primitives */
case 'b': {
zend_bool bool_val = va_arg(va, int);
ZVAL_BOOL(&stack[arg_idx], bool_val);
break;
}
case 'd': {
double double_val = va_arg(va, double);
ZVAL_DOUBLE(&stack[arg_idx], double_val);
break;
}
case 'l': {
zend_ulong long_val = va_arg(va, zend_ulong);
ZVAL_LONG(&stack[arg_idx], long_val);
break;
}
/* strings (zend_string), not supported in PHP 5.6, therefore not supported */
case 'P':
case 'S':
/* unsupported */
case 'C':
case 'f':
case 'h':
case 'H':
case 'O':
aws_php_throw_exception("Unsupported argument type to aws_php_invoke_callback: %c", arg_type);
break;
default:
aws_php_throw_exception("Unsupported argument type to aws_php_invoke_callback: %c", arg_type);
break;
}
++arg_idx;
}
va_end(va);
/* set up the stack for the call */
#if AWS_PHP_AT_LEAST_7
zend_fcall_info_argp(&fci, num_args, stack);
#else
/* PHP5.6 may mutate the arguments due to coercion */
zval **arg_ptrs = alloca(sizeof(zval *) * num_args);
zval ***args = alloca(sizeof(zval **) * num_args);
for (int arg_idx = 0; arg_idx < num_args; ++arg_idx) {
arg_ptrs[arg_idx] = &stack[arg_idx];
args[arg_idx] = &arg_ptrs[arg_idx];
}
fci.param_count = num_args;
fci.params = args;
#endif
zval retval;
/* PHP5 allocates its own return value, 7+ uses an existing one we provide */
#if !AWS_PHP_AT_LEAST_7
zval *retval5 = NULL;
fci.retval_ptr_ptr = &retval5;
#else
fci.retval = &retval;
#endif
if (zend_call_function(&fci, &fcc) == FAILURE) {
aws_php_throw_exception("zend_call_function failed in aws_php_invoke_callback");
}
#if !AWS_PHP_AT_LEAST_7
/* initialize the local retval from the retval in retval_ptr_ptr above */
if (retval5) {
ZVAL_ZVAL(&retval, retval5, 1, 1);
}
#endif
/* Clean up arguments */
#if AWS_PHP_AT_LEAST_7
zend_fcall_info_args_clear(&fci, 1);
#endif
return retval;
}
void aws_php_zval_stringl(zval *val, const char *str, size_t len) {
AWS_FATAL_ASSERT(val != NULL);
#if AWS_PHP_AT_LEAST_7
ZVAL_STRINGL(val, str, len);
#else
ZVAL_STRINGL(val, str, len, 1);
#endif
}
aws_php_thread_queue s_aws_php_main_thread_queue;
bool aws_php_is_main_thread(void) {
return s_aws_php_main_thread_queue.thread_id == aws_thread_current_thread_id();
}
void aws_php_thread_queue_init(aws_php_thread_queue *queue) {
aws_mutex_init(&queue->mutex);
memset(queue->queue, 0, sizeof(aws_php_task) * AWS_PHP_THREAD_QUEUE_MAX_DEPTH);
queue->write_slot = 0;
queue->thread_id = aws_thread_current_thread_id();
}
void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue) {
assert(queue->write_slot == 0 && "aws_php_thread_queue cannot be cleaned up while queue is not empty");
aws_mutex_clean_up(&queue->mutex);
}
void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task) {
aws_mutex_lock(&queue->mutex);
assert(queue->write_slot < AWS_PHP_THREAD_QUEUE_MAX_DEPTH && "thread queue is full");
queue->queue[queue->write_slot++] = task;
aws_mutex_unlock(&queue->mutex);
}
bool aws_php_thread_queue_drain(aws_php_thread_queue *queue) {
assert(
queue->thread_id == aws_thread_current_thread_id() &&
"thread queue cannot be drained from a thread other than its home");
aws_php_task drain_queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH];
aws_mutex_lock(&queue->mutex);
/* copy any queued tasks into the drain queue, then reset the queue */
memcpy(drain_queue, queue->queue, sizeof(aws_php_task) * AWS_PHP_THREAD_QUEUE_MAX_DEPTH);
memset(queue->queue, 0, sizeof(aws_php_task) * AWS_PHP_THREAD_QUEUE_MAX_DEPTH);
queue->write_slot = 0;
aws_mutex_unlock(&queue->mutex);
bool did_work = false;
for (int idx = 0; idx < AWS_PHP_THREAD_QUEUE_MAX_DEPTH; ++idx) {
aws_php_task *task = &drain_queue[idx];
if (!task->callback) {
break;
}
did_work = true;
task->callback(task->data);
if (task->dtor) {
task->dtor(task->data);
}
}
return did_work;
}
/* called on main thread after delivery */
static void s_thread_queue_complete_promise(void *data) {
struct aws_promise *promise = data;
aws_promise_complete(promise, NULL, NULL);
}
/* called from worker thread to wait for the main thread to execute any queued work in PHP */
void aws_php_thread_queue_yield(aws_php_thread_queue *queue) {
/* If on the main thread, then just drain the queue */
if (aws_php_is_main_thread()) {
aws_php_thread_queue_drain(queue);
} else {
/* push a task onto the end of the queue, we will return once this task completes our promise */
struct aws_promise *queue_drained = aws_promise_new(aws_crt_default_allocator());
aws_php_task queue_drained_task = {
.callback = s_thread_queue_complete_promise,
.data = queue_drained,
};
aws_php_thread_queue_push(queue, queue_drained_task);
aws_promise_wait(queue_drained);
aws_promise_release(queue_drained);
}
}
/* called from PHP thread to wait on async queued jobs, one of which should complete the promise */
void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise) {
while (!aws_promise_is_complete(promise)) {
aws_php_thread_queue_drain(queue);
}
}
ZEND_DECLARE_MODULE_GLOBALS(awscrt);
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY(
"awscrt.log_level",
"",
PHP_INI_ALL,
OnUpdateLongGEZero,
log_level,
zend_awscrt_globals,
awscrt_globals)
PHP_INI_END()
static PHP_MINIT_FUNCTION(awscrt) {
REGISTER_INI_ENTRIES();
/* prevent s2n from initializing/de-initializing OpenSSL/libcrypto */
aws_crt_crypto_share();
aws_crt_init();
aws_php_thread_queue_init(&s_aws_php_main_thread_queue);
return SUCCESS;
}
static PHP_MSHUTDOWN_FUNCTION(awscrt) {
UNREGISTER_INI_ENTRIES();
aws_php_thread_queue_clean_up(&s_aws_php_main_thread_queue);
aws_crt_thread_join_all(0);
aws_crt_clean_up();
return SUCCESS;
}
static PHP_GINIT_FUNCTION(awscrt) {
#if defined(COMPILE_DL_ASTKIT) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
awscrt_globals->log_level = 0;
}
zend_module_entry awscrt_module_entry = {
STANDARD_MODULE_HEADER,
"awscrt",
ext_functions, /* functions */
PHP_MINIT(awscrt),
PHP_MSHUTDOWN(awscrt),
NULL, /* RINIT */
NULL, /* RSHUTDOWN */
NULL, /* MINFO */
NO_VERSION_YET,
PHP_MODULE_GLOBALS(awscrt),
PHP_GINIT(awscrt),
NULL, /* GSHUTDOWN */
NULL, /* RPOSTSHUTDOWN */
STANDARD_MODULE_PROPERTIES_EX,
};
#ifdef COMPILE_DL_AWSCRT
ZEND_GET_MODULE(awscrt)
#endif
/* aws_crt_last_error() */
PHP_FUNCTION(aws_crt_last_error) {
RETURN_LONG(aws_crt_last_error());
}
/* aws_crt_error_str(int error_code) */
PHP_FUNCTION(aws_crt_error_str) {
zend_ulong error_code = 0;
aws_php_parse_parameters("l", &error_code);
XRETURN_STRING(aws_crt_error_str(error_code));
}
/* aws_crt_error_name(int error_code) */
PHP_FUNCTION(aws_crt_error_name) {
zend_ulong error_code = 0;
aws_php_parse_parameters("l", &error_code);
XRETURN_STRING(aws_crt_error_name(error_code));
}
/* aws_crt_error_debug_str(int error_code) */
PHP_FUNCTION(aws_crt_error_debug_str) {
zend_ulong error_code = 0;
aws_php_parse_parameters("l", &error_code);
XRETURN_STRING(aws_crt_error_debug_str(error_code));
}

View file

@ -1,48 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_event_loop_group_options_new) {
aws_php_parse_parameters_none();
aws_crt_event_loop_group_options *options = aws_crt_event_loop_group_options_new();
RETURN_LONG((zend_ulong)options);
}
PHP_FUNCTION(aws_crt_event_loop_group_options_release) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_event_loop_group_options *options = (void *)php_options;
aws_crt_event_loop_group_options_release(options);
}
PHP_FUNCTION(aws_crt_event_loop_group_options_set_max_threads) {
zend_ulong php_options = 0;
zend_ulong num_threads = 0;
aws_php_parse_parameters("ll", &php_options, &num_threads);
aws_crt_event_loop_group_options *options = (void *)php_options;
aws_crt_event_loop_group_options_set_max_threads(options, num_threads);
}
PHP_FUNCTION(aws_crt_event_loop_group_new) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_event_loop_group_options *options = (void *)php_options;
aws_crt_event_loop_group *elg = aws_crt_event_loop_group_new(options);
RETURN_LONG((zend_ulong)elg);
}
PHP_FUNCTION(aws_crt_event_loop_group_release) {
zend_ulong php_elg = 0;
aws_php_parse_parameters("l", &php_elg);
aws_crt_event_loop_group *elg = (void *)php_elg;
aws_crt_event_loop_group_release(elg);
}

View file

@ -1,36 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_http_message_new_from_blob) {
const char *blob = NULL;
size_t blob_len = 0;
aws_php_parse_parameters("s", &blob, &blob_len);
aws_crt_http_message *message = aws_crt_http_message_new_from_blob((uint8_t *)blob, blob_len);
RETURN_LONG((zend_ulong)message);
}
PHP_FUNCTION(aws_crt_http_message_to_blob) {
zend_ulong php_msg = 0;
aws_php_parse_parameters("l", &php_msg);
aws_crt_http_message *message = (void *)php_msg;
aws_crt_buf blob;
aws_crt_http_message_to_blob(message, &blob);
XRETURN_STRINGL((const char *)blob.blob, blob.length);
}
PHP_FUNCTION(aws_crt_http_message_release) {
zend_ulong php_msg = 0;
aws_php_parse_parameters("l", &php_msg);
aws_crt_http_message *message = (void *)php_msg;
aws_crt_http_message_release(message);
}

View file

@ -1,65 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_log_to_stdout) {
aws_php_parse_parameters_none();
aws_crt_log_to_stdout();
}
PHP_FUNCTION(aws_crt_log_to_stderr) {
aws_php_parse_parameters_none();
aws_crt_log_to_stderr();
}
PHP_FUNCTION(aws_crt_log_to_file) {
const char *filename = NULL;
size_t filename_len = 0;
/* read the filename as a path, which guarantees no NUL bytes */
aws_php_parse_parameters("p", &filename, &filename_len);
aws_crt_log_to_file(filename);
}
static void php_crt_log(const char *message, size_t len, void *user_data) {
php_stream *stream = user_data;
php_stream_write(stream, message, len);
php_stream_flush(stream);
}
PHP_FUNCTION(aws_crt_log_to_stream) {
zval *php_log_stream = NULL;
aws_php_parse_parameters("r", &php_log_stream);
if (php_log_stream) {
php_stream *stream = NULL;
Z_ADDREF(*php_log_stream);
AWS_PHP_STREAM_FROM_ZVAL(stream, php_log_stream);
aws_crt_log_to_callback((aws_crt_log_callback *)php_crt_log, stream);
} else {
aws_crt_log_to_callback(NULL, NULL);
}
}
PHP_FUNCTION(aws_crt_log_set_level) {
zend_ulong log_level = 0;
aws_php_parse_parameters("l", &log_level);
aws_crt_log_set_level((aws_crt_log_level)log_level);
}
PHP_FUNCTION(aws_crt_log_stop) {
aws_php_parse_parameters_none();
aws_crt_log_stop();
}
PHP_FUNCTION(aws_crt_log_message) {
zend_ulong log_level = 0;
const char *message = NULL;
size_t message_len = 0;
aws_php_parse_parameters("ls", &log_level, &message, &message_len);
aws_crt_log_message((aws_crt_log_level)log_level, (const uint8_t *)message, message_len);
}

View file

@ -1,171 +0,0 @@
#ifndef PHP_AWS_CRT_H
#define PHP_AWS_CRT_H
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "php.h"
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
#include <aws/common/common.h>
#include <aws/common/mutex.h>
#include <aws/common/promise.h>
#include <aws/common/thread.h>
/* ZEND_EXTENSION_API_NO from each branch of the PHP source */
#define AWS_PHP_EXTENSION_API_5_5 220121212
#define AWS_PHP_EXTENSION_API_5_6 220131226
#define AWS_PHP_EXTENSION_API_7_0 320151012
#define AWS_PHP_EXTENSION_API_7_1 320160303
#define AWS_PHP_EXTENSION_API_7_2 320170718
#define AWS_PHP_EXTENSION_API_7_3 320180731
#define AWS_PHP_EXTENSION_API_7_4 320190902
#define AWS_PHP_EXTENSION_API_8_0 420200930
#if ZEND_EXTENSION_API_NO < AWS_PHP_EXTENSION_API_5_5
# error "PHP >= 5.5 is required"
#endif
#define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0)
#define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2)
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
long log_level;
ZEND_END_MODULE_GLOBALS(awscrt)
ZEND_EXTERN_MODULE_GLOBALS(awscrt)
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
#if AWS_PHP_AT_LEAST_7
/* PHP 7 takes a zval*, PHP5 takes a zval** */
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z)
#define XRETURN_STRINGL RETURN_STRINGL
#define XRETURN_STRING RETURN_STRING
#define XRETVAL_STRINGL RETVAL_STRINGL
#define XRETVAL_STRING RETVAL_STRING
#else /* PHP 5.5-5.6 */
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z)
#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1)
#define XRETURN_STRING(s) RETURN_STRING(s, 1)
#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1)
#define XRETVAL_STRING(s) RETVAL_STRING(s, 1)
#endif /* PHP 5.x */
#include "api.h"
#include "awscrt_arginfo.h"
/* Utility macros borrowed from common */
#define GLUE(x, y) x y
#define RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, count, ...) count
#define EXPAND_ARGS(args) RETURN_ARG_COUNT args
#define COUNT_ARGS_MAX5(...) EXPAND_ARGS((__VA_ARGS__, 5, 4, 3, 2, 1, 0))
#define OVERLOAD_MACRO2(name, count) name##count
#define OVERLOAD_MACRO1(name, count) OVERLOAD_MACRO2(name, count)
#define OVERLOAD_MACRO(name, count) OVERLOAD_MACRO1(name, count)
#define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__))
#define VARIABLE_LENGTH_ARRAY(type, name, length) type *name = alloca(sizeof(type) * (length))
/*
* PHP utility APIs for this extension
*/
/*
* Exception throwing mechanism, will never return
*/
#define aws_php_throw_exception(...) CALL_OVERLOAD(_AWS_PHP_THROW_EXCEPTION, __VA_ARGS__);
#define _AWS_PHP_THROW_EXCEPTION5(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
#define _AWS_PHP_THROW_EXCEPTION4(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
#define _AWS_PHP_THROW_EXCEPTION3(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
#define _AWS_PHP_THROW_EXCEPTION2(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
#define _AWS_PHP_THROW_EXCEPTION1(format) zend_error_noreturn(E_ERROR, format)
/**
* throws an exception resulting from argument parsing, notes the current function name in the exception
*/
#define aws_php_argparse_fail() \
do { \
aws_php_throw_exception("Failed to parse arguments to %s", __func__); \
} while (0)
/**
* calls zend_parse_parameters() with the arguments and throws an exception if parsing fails
*/
#define aws_php_parse_parameters(type_spec, ...) \
do { \
if (zend_parse_parameters(ZEND_NUM_ARGS(), type_spec, __VA_ARGS__) == FAILURE) { \
aws_php_argparse_fail(); \
} \
} while (0)
/**
* calls zend_parse_parameters_none() and throws an exception if parsing fails
*/
#define aws_php_parse_parameters_none() \
do { \
if (zend_parse_parameters_none() == FAILURE) { \
aws_php_argparse_fail(); \
} \
} while (0)
/* PHP/Zend utility functions to work across PHP versions */
zval *aws_php_zval_new(void);
void aws_php_zval_dtor(void *zval_ptr);
bool aws_php_zval_as_bool(zval *z);
void aws_php_zval_copy(zval *dest, zval *src);
/**
* Replacement for ZVAL_STRINGL that is PHP version agnostic
*/
void aws_php_zval_stringl(zval *val, const char *str, size_t len);
/* Thread queue functions for managing PHP's optional threading situation */
typedef struct _aws_php_task {
void (*callback)(void *); /* task function */
void (*dtor)(void *); /* deletes task_data, if non-null */
void *data;
} aws_php_task;
/* maximum number of queued callbacks to execute at once. Since this is to support single-threaded usage,
* this can be a fairly small number, as how many callbacks could we reasonably be stacking up?! */
#define AWS_PHP_THREAD_QUEUE_MAX_DEPTH 32
typedef struct _aws_php_thread_queue {
struct aws_mutex mutex;
aws_php_task queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH];
size_t write_slot;
aws_thread_id_t thread_id;
} aws_php_thread_queue;
extern aws_php_thread_queue s_aws_php_main_thread_queue;
bool aws_php_is_main_thread(void);
void aws_php_thread_queue_init(aws_php_thread_queue *queue);
void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue);
void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task);
bool aws_php_thread_queue_drain(aws_php_thread_queue *queue);
/* called from worker thread to wait for the main thread to execute any queued work in PHP */
void aws_php_thread_queue_yield(aws_php_thread_queue *queue);
/* called from PHP thread to wait on async queued jobs, one of which MUST complete the promise */
void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise);
/**
* generic dispatch mechanism to call a callback provided as a zval with arguments
* that are converted to zvals based on the arg_types format string
* Uses the same format string as zend_parse_parameters
*/
zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...);
#endif /* PHP_AWS_CRT_H */

View file

@ -1,33 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
zval *aws_php_zval_new(void) {
return emalloc(sizeof(zval));
}
void aws_php_zval_dtor(void *zval_ptr) {
zval *z = zval_ptr;
zval_dtor(z);
efree(z);
}
bool aws_php_zval_as_bool(zval *z) {
#if AWS_PHP_AT_LEAST_7
return (Z_TYPE_P(z) == IS_TRUE);
#else
return (Z_TYPE_P(z) == IS_BOOL && Z_LVAL_P(z) != 0);
#endif
}
void aws_php_zval_copy(zval *dest, zval *src) {
#if AWS_PHP_AT_LEAST_7
ZVAL_COPY(dest, src);
#else
ZVAL_COPY_VALUE(dest, src);
#endif
}

View file

@ -1,374 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_signing_config_aws_new) {
if (zend_parse_parameters_none() == FAILURE) {
RETURN_NULL();
}
aws_crt_signing_config_aws *signing_config = aws_crt_signing_config_aws_new();
RETURN_LONG((zend_ulong)signing_config);
}
PHP_FUNCTION(aws_crt_signing_config_aws_release) {
zend_ulong php_signing_config = 0;
aws_php_parse_parameters("l", &php_signing_config);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_release(signing_config);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_algorithm) {
zend_ulong php_signing_config = 0;
zend_ulong php_algorithm = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_algorithm);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_algorithm algorithm = php_algorithm;
aws_crt_signing_config_aws_set_algorithm(signing_config, algorithm);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_signature_type) {
zend_ulong php_signing_config = 0;
zend_ulong php_signature_type = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_signature_type);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signature_type signature_type = php_signature_type;
aws_crt_signing_config_aws_set_signature_type(signing_config, signature_type);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider) {
zend_ulong php_signing_config = 0;
zend_ulong php_credentials_provider = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_credentials_provider);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_credentials_provider *credentials_provider = (void *)php_credentials_provider;
aws_crt_signing_config_aws_set_credentials_provider(signing_config, credentials_provider);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_region) {
zend_ulong php_signing_config = 0;
const char *region = NULL;
size_t region_len = 0;
aws_php_parse_parameters("ls", &php_signing_config, &region, &region_len);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_region(signing_config, (uint8_t *)region, region_len);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_service) {
zend_ulong php_signing_config = 0;
const char *service = NULL;
size_t service_len = 0;
aws_php_parse_parameters("ls", &php_signing_config, &service, &service_len);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_service(signing_config, (uint8_t *)service, service_len);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode) {
zend_ulong php_signing_config = 0;
zend_bool php_use_double_uri_encode = 0;
aws_php_parse_parameters("lb", &php_signing_config, &php_use_double_uri_encode);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_use_double_uri_encode(signing_config, php_use_double_uri_encode);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path) {
zend_ulong php_signing_config = 0;
zend_bool php_should_normalize_uri_path = 0;
aws_php_parse_parameters("lb", &php_signing_config, &php_should_normalize_uri_path);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_should_normalize_uri_path(signing_config, php_should_normalize_uri_path);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token) {
zend_ulong php_signing_config = 0;
zend_bool php_omit_session_token = 0;
aws_php_parse_parameters("lb", &php_signing_config, &php_omit_session_token);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_omit_session_token(signing_config, php_omit_session_token);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value) {
zend_ulong php_signing_config = 0;
const char *signed_body_value = NULL;
size_t signed_body_value_len = 0;
aws_php_parse_parameters("ls", &php_signing_config, &signed_body_value, &signed_body_value_len);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_signed_body_value(
signing_config, (uint8_t *)signed_body_value, signed_body_value_len);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type) {
zend_ulong php_signing_config = 0;
zend_ulong php_signed_body_header_type = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_signed_body_header_type);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signed_body_header_type signed_body_header_type = php_signed_body_header_type;
aws_crt_signing_config_aws_set_signed_body_header_type(signing_config, signed_body_header_type);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds) {
zend_ulong php_signing_config = 0;
zend_ulong php_expiration_in_seconds = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_expiration_in_seconds);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_expiration_in_seconds(signing_config, php_expiration_in_seconds);
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_date) {
zend_ulong php_signing_config = 0;
zend_ulong php_timestamp = 0;
aws_php_parse_parameters("ll", &php_signing_config, &php_timestamp);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
aws_crt_signing_config_aws_set_date(signing_config, php_timestamp);
}
typedef struct _should_sign_header_data {
zval *should_sign_header;
zval *header_name;
bool result;
} should_sign_header_data;
static void should_sign_header_task(void *data) {
should_sign_header_data *task = data;
zval result = aws_php_invoke_callback(task->should_sign_header, "z", task->header_name);
task->result = aws_php_zval_as_bool(&result);
zval_dtor(&result);
}
static bool aws_php_should_sign_header(const char *header_name, size_t header_length, void *user_data) {
zval php_header_name;
aws_php_zval_stringl(&php_header_name, header_name, header_length);
should_sign_header_data task_data = {
.should_sign_header = user_data,
.header_name = &php_header_name,
.result = false,
};
aws_php_task task = {
.callback = should_sign_header_task,
.data = &task_data,
};
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, task);
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
zval_dtor(&php_header_name);
return task_data.result;
}
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn) {
zend_ulong php_signing_config = 0;
zval *php_should_sign_header = NULL;
aws_php_parse_parameters("lz", &php_signing_config, &php_should_sign_header);
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
/* copy/retain PHP callback, add as user data for signing_config resource */
zval *should_sign_header = aws_php_zval_new();
aws_php_zval_copy(should_sign_header, php_should_sign_header);
aws_crt_resource_set_user_data(signing_config, should_sign_header, aws_php_zval_dtor);
aws_crt_signing_config_aws_set_should_sign_header_fn(
signing_config, aws_php_should_sign_header, should_sign_header);
}
PHP_FUNCTION(aws_crt_signable_new_from_http_request) {
zend_ulong php_http_message = 0;
aws_php_parse_parameters("l", &php_http_message);
const aws_crt_http_message *http_message = (void *)php_http_message;
aws_crt_signable *signable = aws_crt_signable_new_from_http_request(http_message);
RETURN_LONG((zend_ulong)signable);
}
PHP_FUNCTION(aws_crt_signable_new_from_chunk) {
zend_ulong php_input_stream = 0;
const char *previous_signature = NULL;
size_t previous_signature_len = 0;
aws_php_parse_parameters("ls", &php_input_stream, &previous_signature, &previous_signature_len);
aws_crt_input_stream *input_stream = (void *)php_input_stream;
aws_crt_signable *signable =
aws_crt_signable_new_from_chunk(input_stream, (uint8_t *)previous_signature, previous_signature_len);
RETURN_LONG((zend_ulong)signable);
}
PHP_FUNCTION(aws_crt_signable_new_from_canonical_request) {
const char *canonical_request = NULL;
size_t canonical_request_len = 0;
aws_crt_signable *signable =
aws_crt_signable_new_from_canonical_request((uint8_t *)canonical_request, canonical_request_len);
RETURN_LONG((zend_ulong)signable);
}
PHP_FUNCTION(aws_crt_signable_release) {
zend_ulong php_signable = 0;
aws_php_parse_parameters("l", &php_signable);
aws_crt_signable *signable = (void *)php_signable;
aws_crt_signable_release(signable);
}
PHP_FUNCTION(aws_crt_signing_result_release) {
zend_ulong php_signing_result = 0;
aws_php_parse_parameters("l", &php_signing_result);
aws_crt_signing_result *result = (void *)php_signing_result;
aws_crt_signing_result_release(result);
}
PHP_FUNCTION(aws_crt_signing_result_apply_to_http_request) {
zend_ulong php_signing_result = 0;
zend_ulong php_http_request = 0;
aws_php_parse_parameters("ll", &php_signing_result, &php_http_request);
aws_crt_signing_result *result = (void *)php_signing_result;
aws_crt_http_message *request = (void *)php_http_request;
if (aws_crt_signing_result_apply_to_http_request(result, request)) {
aws_php_throw_exception(
"Failed to apply signing result to HTTP request: %s", aws_crt_error_name(aws_crt_last_error()));
}
}
typedef struct _signing_state {
struct aws_promise *promise;
zval *on_complete;
aws_crt_signing_result *signing_result;
int error_code;
} signing_state;
/* called on main thread to deliver result to php */
static void s_sign_aws_complete(void *data) {
signing_state *state = data;
zval *on_complete = state->on_complete;
aws_php_invoke_callback(on_complete, "ll", (zend_ulong)state->signing_result, (zend_ulong)state->error_code);
}
/* called from signing process in aws_sign_request_aws */
static void s_on_sign_request_aws_complete(aws_crt_signing_result *result, int error_code, void *user_data) {
signing_state *state = user_data;
struct aws_promise *promise = state->promise;
state->signing_result = result;
state->error_code = error_code;
/*
* Must execute PHP callback before this function returns, or signing_result will be killed
* so the callback is queued back to the main thread and will have run when yield returns
*/
aws_php_task complete_callback_task = {
.callback = s_sign_aws_complete,
.data = state,
};
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, complete_callback_task);
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
if (error_code) {
aws_promise_fail(promise, error_code);
} else {
aws_promise_complete(promise, result, NULL);
}
}
PHP_FUNCTION(aws_crt_sign_request_aws) {
zend_ulong php_signable = 0;
zend_ulong php_signing_config = 0;
zval *php_on_complete = 0;
zend_ulong php_user_data = 0;
aws_php_parse_parameters("llzl", &php_signable, &php_signing_config, &php_on_complete, &php_user_data);
aws_crt_signable *signable = (void *)php_signable;
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
struct aws_promise *promise = aws_promise_new(aws_crt_default_allocator());
signing_state state = {
.promise = promise,
.on_complete = php_on_complete,
};
int ret = aws_crt_sign_request_aws(signable, signing_config, s_on_sign_request_aws_complete, &state);
if (ret != 0) {
int last_error = aws_crt_last_error();
aws_promise_fail(promise, last_error);
aws_php_throw_exception(
"aws_crt_sign_request_aws: error starting signing process: %s", aws_crt_error_name(last_error));
}
aws_php_thread_queue_wait(&s_aws_php_main_thread_queue, promise);
done:
aws_promise_release(promise);
RETURN_LONG(ret);
}
PHP_FUNCTION(aws_crt_test_verify_sigv4a_signing) {
zend_ulong php_signable = 0;
zend_ulong php_signing_config = 0;
const char *expected_canonical_request = NULL;
size_t expected_canonical_request_len = 0;
const char *signature = NULL;
size_t signature_len = 0;
const char *ecc_key_pub_x = NULL;
size_t ecc_key_pub_x_len = 0;
const char *ecc_key_pub_y = NULL;
size_t ecc_key_pub_y_len = 0;
aws_php_parse_parameters(
"llssss",
&php_signable,
&php_signing_config,
&expected_canonical_request,
&expected_canonical_request_len,
&signature,
&signature_len,
&ecc_key_pub_x,
&ecc_key_pub_x_len,
&ecc_key_pub_y,
&ecc_key_pub_y_len);
const aws_crt_signable *signable = (void *)php_signable;
const aws_crt_signing_config *signing_config = (void *)php_signing_config;
bool result = AWS_OP_SUCCESS ==
aws_crt_test_verify_sigv4a_signing(
signable, signing_config, expected_canonical_request, signature, ecc_key_pub_x, ecc_key_pub_y);
RETURN_BOOL(result);
}

View file

@ -1,148 +0,0 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
/* PHP streams info:
* https://git.php.net/?p=php-src.git;a=blob;f=docs/streams.md;h=0ec3846d68bf70067297d8a6c691d2591c49b48a;hb=HEAD
* https://github.com/php/php-src/blob/PHP-5.6.0/main/php_streams.h
*/
PHP_FUNCTION(aws_crt_input_stream_options_new) {
if (zend_parse_parameters_none() == FAILURE) {
aws_php_argparse_fail();
}
aws_crt_input_stream_options *options = aws_crt_input_stream_options_new();
RETURN_LONG((zend_ulong)options);
}
PHP_FUNCTION(aws_crt_input_stream_options_release) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_input_stream_options *options = (void *)php_options;
aws_crt_input_stream_options_release(options);
}
PHP_FUNCTION(aws_crt_input_stream_options_set_user_data) {
zend_ulong php_options = 0;
zval *user_data = NULL;
aws_php_parse_parameters("lz", &php_options, &user_data);
aws_crt_input_stream_options *options = (void *)php_options;
php_stream *stream = NULL;
AWS_PHP_STREAM_FROM_ZVAL(stream, user_data);
aws_crt_input_stream_options_set_user_data(options, stream);
}
static int s_php_stream_seek(void *user_data, int64_t offset, aws_crt_input_stream_seek_basis basis) {
php_stream *stream = user_data;
return php_stream_seek(stream, offset, basis);
}
static int s_php_stream_read(void *user_data, uint8_t *dest, size_t dest_length) {
php_stream *stream = user_data;
return php_stream_read(stream, (char *)dest, dest_length) != 0;
}
static int s_php_stream_get_length(void *user_data, int64_t *out_length) {
php_stream *stream = user_data;
size_t pos = php_stream_tell(stream);
php_stream_seek(stream, 0, SEEK_END);
*out_length = php_stream_tell(stream);
php_stream_seek(stream, pos, SEEK_SET);
return 0;
}
static int s_php_stream_get_status(void *user_data, aws_crt_input_stream_status *out_status) {
php_stream *stream = user_data;
out_status->is_valid = stream != NULL;
/* We would like to use php_stream_eof here, but certain streams (notably php://memory)
* are not actually capable of EOF, so we get to do it the hard way */
int64_t length = 0;
int64_t pos = 0;
s_php_stream_get_length(stream, &length);
pos = php_stream_tell(stream);
out_status->is_end_of_stream = pos == length;
return 0;
}
static void s_php_stream_destroy(void *user_data) {
(void)user_data;
/* no op, stream will be freed by PHP refcount dropping from InputStream::stream */
}
PHP_FUNCTION(aws_crt_input_stream_new) {
zend_ulong php_options = 0;
aws_php_parse_parameters("l", &php_options);
aws_crt_input_stream_options *options = (void *)php_options;
aws_crt_input_stream_options_set_seek(options, s_php_stream_seek);
aws_crt_input_stream_options_set_read(options, s_php_stream_read);
aws_crt_input_stream_options_set_get_status(options, s_php_stream_get_status);
aws_crt_input_stream_options_set_get_length(options, s_php_stream_get_length);
aws_crt_input_stream_options_set_destroy(options, s_php_stream_destroy);
aws_crt_input_stream *stream = aws_crt_input_stream_new(options);
RETURN_LONG((zend_ulong)stream);
}
PHP_FUNCTION(aws_crt_input_stream_release) {
zend_ulong php_stream = 0;
aws_php_parse_parameters("l", &php_stream);
aws_crt_input_stream *stream = (void *)php_stream;
aws_crt_input_stream_release(stream);
}
PHP_FUNCTION(aws_crt_input_stream_seek) {
zend_ulong php_stream = 0;
zend_ulong offset = 0;
zend_ulong basis = 0;
aws_php_parse_parameters("lll", &php_stream, &offset, &basis);
aws_crt_input_stream *stream = (void *)php_stream;
RETURN_LONG(aws_crt_input_stream_seek(stream, offset, basis));
}
PHP_FUNCTION(aws_crt_input_stream_read) {
zend_ulong php_stream = 0;
zend_ulong length = 0;
aws_php_parse_parameters("ll", &php_stream, &length);
aws_crt_input_stream *stream = (void *)php_stream;
uint8_t *buf = emalloc(length);
int ret = aws_crt_input_stream_read(stream, buf, length);
XRETVAL_STRINGL((const char *)buf, length);
efree(buf);
}
PHP_FUNCTION(aws_crt_input_stream_eof) {
zend_ulong php_stream = 0;
aws_php_parse_parameters("l", &php_stream);
aws_crt_input_stream *stream = (void *)php_stream;
aws_crt_input_stream_status status = {0};
aws_crt_input_stream_get_status(stream, &status);
RETURN_BOOL(status.is_end_of_stream);
}
PHP_FUNCTION(aws_crt_input_stream_get_length) {
zend_ulong php_stream = 0;
aws_php_parse_parameters("l", &php_stream);
aws_crt_input_stream *stream = (void *)php_stream;
int64_t length = 0;
aws_crt_input_stream_get_length(stream, &length);
RETURN_LONG(length);
}

View file

@ -1,24 +0,0 @@
#!/bin/bash
if [[ -z $CLANG_FORMAT ]] ; then
CLANG_FORMAT=clang-format
fi
if NOT type $CLANG_FORMAT 2> /dev/null ; then
echo "No appropriate clang-format found."
exit 1
fi
FAIL=0
SOURCE_FILES=`find src ext -type f \( -name '*.c' \)`
for i in $SOURCE_FILES
do
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
if [ $? -ne 1 ]
then
echo "$i failed clang-format check."
FAIL=1
fi
done
exit $FAIL

View file

@ -1,24 +0,0 @@
<?php
$source = "php://stdin";
if (isset($argv[1])) {
$source = $argv[1];
}
$input_lines = file($source);
foreach ($input_lines as $line) {
// Strip AWS_EXTERN_C_BEGIN/END
if (preg_match('/AWS_EXTERN_C/', $line)) {
continue;
}
// Strip macros/includes
if (preg_match('/^#/', $line)) {
continue;
}
// Strip visibility attributes
$line = str_replace('AWS_CRT_API ', '', $line);
echo($line);
}

File diff suppressed because it is too large Load diff

View file

@ -1,19 +0,0 @@
</contents>
<dependencies>
<required>
<php>
<min>7.4.0</min>
</php>
<pearinstaller>
<min>1.10.0</min>
</pearinstaller>
</required>
</dependencies>
<providesextension>awscrt</providesextension>
<extsrcrelease/>
<changelog>
<release>
</release>
</changelog>
</package>

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.8.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>awscrt</name>
<channel>pecl.php.net</channel>
<summary>AWS Common Runtime PHP bindings</summary>
<description>AWS Common Runtime provides a set of low level tools as network protocols and authentication used by the AWSSDK for PHP to provide high level API to access AWS services.</description>
<lead>
<name>{{{NAME}}}</name>
<user>{{{USER}}}</user>
<email>{{{EMAIL}}}</email>
<active>yes</active>
</lead>
<date>{{{TODAY}}}</date>
<version>
<release>{{{VERSION}}}</release>
<api>1.0.0</api>
</version>
<stability>
<release>devel</release>
<api>stable</api>
</stability>
<license uri="https://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</license>
<notes>{{{NOTES}}}</notes>
<contents>

View file

@ -1,2 +0,0 @@
extension=php_awscrt.dll
extension=php_openssl.dll

View file

@ -1 +0,0 @@
extension=modules/awscrt.so

View file

@ -1,144 +0,0 @@
#!/bin/zsh
zparseopts -A opts -name: -user: -email: -version: -notes:
if [[ $# -lt 10 ]]
then
echo "Usage ${0} --name NAME, --user USER --email EMAIL --version VERSION --notes NOTES"
exit 1
fi
NAME="${opts[--name]}"
USER="${opts[--user]}"
EMAIL="${opts[--email]}"
VERSION="${opts[--version]}"
NOTES="${opts[--notes]}"
TODAY=$(date -u +%Y-%m-%d)
cat package.xml-template_pre \
| sed "s/{{{NAME}}}/$NAME/g" \
| sed "s/{{{USER}}}/$USER/g" \
| sed "s/{{{EMAIL}}}/$EMAIL/g" \
| sed "s/{{{TODAY}}}/$TODAY/g" \
| sed "s/{{{VERSION}}}/$VERSION/g" \
| sed "s/{{{NOTES}}}/$NOTES/g"
source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)'
doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)'
special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)'
special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)'
special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)'
skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)'
special_scripts='(awscrt.stub.php)'
skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)'
process_file() {
if (( $# == 0 ))
then
echo "ERROR: filename not passed"
exit 1
fi
if [[ $1 = $~skip_files ]]
then
# This file is not part of the release bundle
return 0
fi
echo -n '<file name="'"$1"'" role="'
# Special cases
case ${a} in
$~special_scripts)
echo -n 'script'
;;
$~special_docs)
echo -n 'doc'
;;
$~special_tests)
echo -n 'test'
;;
$~special_src)
echo -n 'src'
;;
*)
# Extension based cases
case ${a:t:e} in
$~source_ext)
echo -n 'src'
;;
$~doc_ext)
echo -n 'doc'
;;
php)
echo -n 'script'
;;
*)
echo "${a:t:e} - ${a} - FAIL TO RECOGNIZE"
exit 1
esac
esac
echo '"/>'
return 0
}
process_dir() {
if (( $# == 0 ))
then
echo "WARNING: dirname not passed"
exit 1
fi
if [[ "${1}" = $~skip_directories ]]
then
return 0
fi
echo '<dir name="'"$1"'">'
cd "$1"
for a in *
do
if [[ -f ${a} ]]
then process_file "${a}"
else process_dir "${a}"
fi
done
# Special cases for compiler features placed in tests directories in and s2n
if [[ "${1}" = "s2n" && -d tests ]]
then
echo '<dir name="tests">'
echo '<dir name="features">'
cd tests/features
for a in *
do
process_file "${a}"
done
cd ../..
echo '</dir>'
echo '</dir>'
fi
echo '</dir>'
cd ..
return 0
}
echo '<dir name="/">'
for a in *
do
if [[ ${a} == 'tests' ]]
then
echo '<dir name="tests">'
for b in tests/*
do
echo '<file name="'$( basename "${b}" )'" role="test" />'
done
echo '</dir>'
continue
fi
if [[ -f ${a} ]]
then process_file "${a}"
else process_dir "${a}"
fi
done
echo '</dir>'
cat package.xml-template_post

View file

@ -1,31 +0,0 @@
#!/bin/zsh
zparseopts -A opts -name: -user: -email: -version: -notes:
if [[ $# -lt 10 ]]; then
echo "Usage ${0} --name NAME --user USER --email EMAIL --version VERSION --notes NOTES"
exit 1
fi
PACKAGE='awscrt'
NAME="${opts[--name]}"
USER="${opts[--user]}"
EMAIL="${opts[--email]}"
VERSION="${opts[--version]}"
NOTES="${opts[--notes]}"
./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml
if [[ $? -ne 0 ]]; then
echo "ERROR PROCESSING review package.xml"
exit 1
fi
tidy -xml -m -i package.xml
pear package-validate
if [[ $? -ne 0 ]]; then
echo "ERROR VALIDATING review package.xml"
exit 1
fi
pear package
if [[ $? -ne 0 ]]; then
echo "ERROR PROCESSING review package.xml"
exit 1
fi
echo "Size of ${PACKAGE}-${VERSION}.tgz: " $(du -h "${PACKAGE}-${VERSION}.tgz")

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -ex
launcher=
if command -v catchsegv; then
launcher=catchsegv
fi
if [ -z $PHP_BINARY ]; then
PHP_BINARY=$(which php)
fi
if [ ! -d vendor ]; then
composer update
fi
$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug

View file

@ -1,4 +0,0 @@
@echo on
%PHP_BINARY% -c php-win.ini vendor/bin/phpunit tests --debug

View file

@ -1,3 +0,0 @@
api.h
pkgconfig/
*.so*

View file

@ -13,7 +13,7 @@ class Request extends Message {
public function __construct($method, $path, $query = [], $headers = [], $body_stream = null) { public function __construct($method, $path, $query = [], $headers = [], $body_stream = null) {
parent::__construct($method, $path, $query, $headers); parent::__construct($method, $path, $query, $headers);
if (!is_null($body_stream) && !($body_stream instanceof InputStream)) { if (!is_null($body_stream) && !($body_stream instanceof InputStream)) {
throw InvalidArgumentException('body_stream must be an instance of ' . InputStream::class); throw new \InvalidArgumentException('body_stream must be an instance of ' . InputStream::class);
} }
$this->body_stream = $body_stream; $this->body_stream = $body_stream;
} }

View file

@ -14,6 +14,7 @@ final class InputStream extends NativeResource {
const SEEK_END = 2; const SEEK_END = 2;
public function __construct($stream) { public function __construct($stream) {
parent::__construct();
$this->stream = $stream; $this->stream = $stream;
$options = self::$crt->input_stream_options_new(); $options = self::$crt->input_stream_options_new();
// The stream implementation in native just converts the PHP stream into // The stream implementation in native just converts the PHP stream into
@ -24,7 +25,7 @@ final class InputStream extends NativeResource {
} }
public function __destruct() { public function __destruct() {
self::$crt->input_stream_release($this->release()); $this->release();
parent::__destruct(); parent::__destruct();
} }

View file

@ -24,7 +24,7 @@ final class Encoding {
public static function decodeString($buffer) { public static function decodeString($buffer) {
$len = unpack("N", $buffer)[1]; $len = unpack("N", $buffer)[1];
$buffer = substr($buffer, 4); $buffer = substr($buffer, 4);
$str = unpack("a${len}", $buffer)[1]; $str = unpack("a{$len}", $buffer)[1];
return [$len, $str]; return [$len, $str];
} }

View file

@ -1,22 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\CRT;
require_once('common.inc');
// This intentionally does not inherit from CrtTestCase because it needs a clean-room environment
final class CoreTest extends PHPUnit_Framework_TestCase {
// The CRT should always be available in this test suite
public function testIsAvailable() {
$this->assertTrue(CRT::isAvailable());
}
// We have done nothing to necessitate loading the CRT, it should not be loaded
public function testIsLoaded() {
$this->assertTrue(!CRT::isLoaded());
}
}

View file

@ -1,90 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\CRT;
require_once('common.inc');
final class CrcTest extends CrtTestCase {
public function testCrc32ZeroesOneShot() {
$input = implode(array_map("chr", array_fill(0, 32, 0)));
$output = CRT::crc32($input);
$expected = 0x190A55AD;
$this->assertEquals($output, $expected);
}
public function testCrc32ZeroesIterated() {
$output = 0;
for ($i = 0; $i < 32; $i++) {
$output = CRT::crc32("\x00", $output);
}
$expected = 0x190A55AD;
$this->assertEquals($output, $expected);
}
public function testCrc32ValuesOneShot() {
$input = implode(array_map("chr", range(0, 31)));
$output = CRT::crc32($input);
$expected = 0x91267E8A;
$this->assertEquals($output, $expected);
}
public function testCrc32ValuesIterated() {
$output = 0;
foreach (range(0, 31) as $n) {
$output = CRT::crc32(chr($n), $output);
}
$expected = 0x91267E8A;
$this->assertEquals($output, $expected);
}
public function testCrc32LargeBuffer() {
$input = implode(array_map("chr", array_fill(0, 1 << 20, 0)));
$output = CRT::crc32($input);
$expected = 0xA738EA1C;
$this->assertEquals($output, $expected);
}
public function testCrc32cZeroesOneShot() {
$input = implode(array_map("chr", array_fill(0, 32, 0)));
$output = CRT::crc32c($input);
$expected = 0x8A9136AA;
$this->assertEquals($output, $expected);
}
public function testCrc32cZeroesIterated() {
$output = 0;
for ($i = 0; $i < 32; $i++) {
$output = CRT::crc32c("\x00", $output);
}
$expected = 0x8A9136AA;
$this->assertEquals($output, $expected);
}
public function testCrc32cValuesOneShot() {
$input = implode(array_map("chr", range(0, 31)));
$output = CRT::crc32c($input);
$expected = 0x46DD794E;
$this->assertEquals($output, $expected);
}
public function testCrc32cValuesIterated() {
$output = 0;
foreach (range(0, 31) as $n) {
$output = CRT::crc32c(chr($n), $output);
}
$expected = 0x46DD794E;
$this->assertEquals($output, $expected);
}
public function testCrc32cLargeBuffer() {
$input = implode(array_map("chr", array_fill(0, 1 << 20, 0)));
$output = CRT::crc32c($input);
$expected = 0x14298C12;
$this->assertEquals($output, $expected);
}
}

View file

@ -1,46 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\Auth\AwsCredentials as AwsCredentials;
use AWS\CRT\Auth\StaticCredentialsProvider as StaticCredentialsProvider;
require_once('common.inc');
final class CredentialsTest extends CrtTestCase {
public function testEmptyCredentials() {
$this->expectException(InvalidArgumentException::class);
$creds = new AwsCredentials(AwsCredentials::defaults());
$this->assertNotNull($creds, "Failed to create default/empty credentials");
$creds = null;
}
private function getCredentialsConfig() {
$options = AwsCredentials::defaults();
$options['access_key_id'] = 'TESTAWSACCESSKEYID';
$options['secret_access_key'] = 'TESTSECRETaccesskeyThatDefinitelyDoesntWork';
$options['session_token'] = 'ThisIsMyTestSessionTokenIMadeItUpMyself';
$options['expiration_timepoint_seconds'] = 42;
return $options;
}
public function testCredentialsLifetime() {
$options = $this->getCredentialsConfig();
$creds = new AwsCredentials($options);
$this->assertNotNull($creds, "Failed to create Credentials with options");
$this->assertEquals($creds->access_key_id, $options['access_key_id']);
$this->assertEquals($creds->secret_access_key, $options['secret_access_key']);
$this->assertEquals($creds->session_token, $options['session_token']);
$this->assertEquals($creds->expiration_timepoint_seconds, $options['expiration_timepoint_seconds']);
$creds = null;
}
public function testStaticCredentialsProviderLifetime() {
$options = $this->getCredentialsConfig();
$provider = new StaticCredentialsProvider($options);
$this->assertNotNull($provider, "Failed to create StaticCredentialsProvider");
$provider = null;
}
}

View file

@ -1,21 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\CRT;
final class ErrorTest extends PHPUnit_Framework_TestCase {
public function testNoInitialError() {
$this->assertEquals(0, CRT::last_error());
}
public function testCanResolveErrorName() {
$this->assertEquals("AWS_ERROR_SUCCESS", CRT::error_name(0));
}
public function testCanResolveErrorStr() {
$this->assertEquals("Success.", CRT::error_str(0));
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\IO\EventLoopGroup as EventLoopGroup;
require_once('common.inc');
final class EventLoopGroupTest extends CrtTestCase {
public function testLifetime() {
$elg = new EventLoopGroup();
$this->assertNotNull($elg, "Failed to create default EventLoopGroup");
$elg = null;
}
public function testConstructionWithOptions() {
$options = EventLoopGroup::defaults();
$options['num_threads'] = 1;
$elg = new EventLoopGroup($options);
$this->assertNotNull($elg, "Failed to create EventLoopGroup with 1 thread");
$elg = null;
}
}

View file

@ -1,95 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\HTTP\Headers;
use AWS\CRT\HTTP\Request;
use AWS\CRT\HTTP\Response;
require_once('common.inc');
final class HttpMessageTest extends CrtTestCase {
public function testHeaders() {
$headers = new Headers();
$this->assertSame(0, $headers->count());
}
public function testHeadersMarshalling() {
$headers_array = [
"host" => "s3.amazonaws.com",
"test" => "this is a test header value"
];
$headers = new Headers($headers_array);
$this->assertSame(2, $headers->count());
$this->assertSame($headers_array['host'], $headers->get('host'));
$this->assertSame($headers_array['test'], $headers->get('test'));
$buffer = Headers::marshall($headers);
$headers_copy = Headers::unmarshall($buffer);
$this->assertSame(2, $headers_copy->count());
$this->assertSame($headers_array['host'], $headers_copy->get('host'));
$this->assertSame($headers_array['test'], $headers_copy->get('test'));
}
private function assertMessagesMatch($a, $b) {
$this->assertSame($a->method(), $b->method());
$this->assertSame($a->path(), $b->path());
$this->assertSame($a->query(), $b->query());
$this->assertSame($a->headers()->toArray(), $b->headers()->toArray());
}
public function testRequestMarshalling() {
$headers = [
"host" => "s3.amazonaws.com",
"test" => "this is a test header value"
];
$method = "GET";
$path = "/index.php";
$query = [];
$msg = new Request($method, $path, $query, $headers);
$msg_buf = Request::marshall($msg);
$msg_copy = Request::unmarshall($msg_buf);
$this->assertMessagesMatch($msg, $msg_copy);
}
public function testRequestMarshallingWithQueryParams() {
$headers = [
"host" => "s3.amazonaws.com",
"test" => "this is a test header value"
];
$method = "GET";
$path = "/index.php";
$query = [
'request' => '1',
'test' => 'true',
'answer' => '42',
'foo' => 'bar',
];
$msg = new Request($method, $path, $query, $headers);
$msg_buf = Request::marshall($msg);
$msg_copy = Request::unmarshall($msg_buf);
$this->assertMessagesMatch($msg, $msg_copy);
}
public function testResponseMarshalling() {
$headers = [
"content-length" => "42",
"test" => "this is a test header value"
];
$method = "GET";
$path = "/index.php";
$query = [
'response' => '1'
];
$msg = new Response($method, $path, $query, $headers, 200);
$msg_buf = Request::marshall($msg);
$msg_copy = Request::unmarshall($msg_buf);
$this->assertMessagesMatch($msg, $msg_copy);
}
}

View file

@ -1,23 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\Log;
require_once('common.inc');
class LogTest extends CrtTestCase {
public function testLogToStream() {
$log_stream = fopen("php://memory", "r+");
$this->assertNotNull($log_stream);
Log::toStream($log_stream);
Log::setLogLevel(Log::TRACE);
Log::log(Log::TRACE, "THIS IS A TEST");
$this->assertTrue(rewind($log_stream));
$log_contents = stream_get_contents($log_stream, -1, 0);
$this->assertStringEndsWith("THIS IS A TEST", trim($log_contents));
Log::stop();
}
}

View file

@ -1,176 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\Auth\SignatureType;
use AWS\CRT\Auth\SigningAlgorithm;
use AWS\CRT\Auth\SigningConfigAWS;
use AWS\CRT\Auth\Signing;
use AWS\CRT\Auth\Signable;
use AWS\CRT\Auth\StaticCredentialsProvider;
use AWS\CRT\HTTP\Request;
require_once('common.inc');
final class SigningTest extends CrtTestCase {
public function testConfigAWSLifetime() {
$config = new SigningConfigAWS();
$this->assertNotNull($config, "Failed to create default SigningConfigAWS");
$config = null;
}
public function testConfigAWSConstructionWithOptions() {
$options = SigningConfigAWS::defaults();
$options['service'] = 'CRT';
$options['region'] = 'CRT';
$config = new SigningConfigAWS($options);
$this->assertNotNull($config, "Failed to create SigningConfigAWS with custom options");
$config = null;
}
public function testSignableFromHttpRequestLifetime() {
$request = new Request('GET', '/');
$signable = Signable::fromHttpRequest($request);
$this->assertNotNull($signable, "Failed to create Signable from HTTP::Request");
$signable = null;
}
public function testSignableFromChunkLifetime() {
$chunk = "THIS IS A TEST CHUNK IT CONTAINS MULTITUDES";
$stream = fopen("php://memory", 'r+');
fputs($stream, $chunk);
rewind($stream);
$signable = Signable::fromChunk($stream);
$this->assertNotNull($signable, "Failed to create Signable from chunk stream");
$signable = null;
}
public function testSignableFromCanonicalRequestLifetime() {
$canonical_request = "THIS IS A CANONICAL_REQUEST. IT IS DEEPLY CANONICAL";
$signable = Signable::fromCanonicalRequest($canonical_request);
$this->assertNotNull($signable, "Failed to create Signable from canonical request");
$signable = null;
}
const SIGV4TEST_ACCESS_KEY_ID = 'AKIDEXAMPLE';
const SIGV4TEST_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY';
const SIGV4TEST_SESSION_TOKEN = null;
const SIGV4TEST_SERVICE = 'service';
const SIGV4TEST_REGION = 'us-east-1';
private static function SIGV4TEST_DATE() {
return mktime(12, 36, 0, 8, 30, 2015);
}
public function testShouldSignHeader() {
$credentials_provider = new StaticCredentialsProvider([
'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID,
'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY,
'session_token' => self::SIGV4TEST_SESSION_TOKEN,
]);
$signing_config = new SigningConfigAWS([
'algorithm' => SigningAlgorithm::SIGv4,
'signature_type' => SignatureType::HTTP_REQUEST_HEADERS,
'credentials_provider' => $credentials_provider,
'region' => self::SIGV4TEST_REGION,
'service' => self::SIGV4TEST_SERVICE,
'date' => self::SIGV4TEST_DATE(),
'should_sign_header' => function($header) {
return strtolower($header) != 'x-do-not-sign';
}
]);
$http_request = new Request('GET', '/', [], [
'Host' => 'example.amazonaws.com',
'X-Do-Not-Sign' => 'DO NOT SIGN THIS']);
$this->assertNotNull($http_request, "Unable to create HttpRequest for signing");
$signable = Signable::fromHttpRequest($http_request);
$this->assertNotNull($signable, "Unable to create signable from HttpRequest");
Signing::signRequestAws(
$signable, $signing_config,
function($signing_result, $error_code) use (&$http_request) {
$this->assertEquals(0, $error_code);
$signing_result->applyToHttpRequest($http_request);
}
);
// This signature value is computed without the X-Do-Not-Sign header above
$headers = $http_request->headers();
$this->assertEquals(
'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31',
$headers->get('Authorization'));
}
public function testSigv4HeaderSigning() {
$credentials_provider = new StaticCredentialsProvider([
'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID,
'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY,
'session_token' => self::SIGV4TEST_SESSION_TOKEN,
]);
$signing_config = new SigningConfigAWS([
'algorithm' => SigningAlgorithm::SIGv4,
'signature_type' => SignatureType::HTTP_REQUEST_HEADERS,
'credentials_provider' => $credentials_provider,
'region' => self::SIGV4TEST_REGION,
'service' => self::SIGV4TEST_SERVICE,
'date' => self::SIGV4TEST_DATE(),
]);
$http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']);
$this->assertNotNull($http_request, "Unable to create HttpRequest for signing");
$signable = Signable::fromHttpRequest($http_request);
$this->assertNotNull($signable, "Unable to create signable from HttpRequest");
Signing::signRequestAws(
$signable, $signing_config,
function($signing_result, $error_code) use (&$http_request) {
$this->assertEquals(0, $error_code);
$signing_result->applyToHttpRequest($http_request);
}
);
$headers = $http_request->headers();
$this->assertEquals(
'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31',
$headers->get('Authorization'));
$this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date'));
}
public function testSigV4aHeaderSigning() {
$credentials_provider = new StaticCredentialsProvider([
'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID,
'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY,
'session_token' => self::SIGV4TEST_SESSION_TOKEN,
]);
$signing_config = new SigningConfigAWS([
'algorithm' => SigningAlgorithm::SIGv4_ASYMMETRIC,
'signature_type' => SignatureType::HTTP_REQUEST_HEADERS,
'credentials_provider' => $credentials_provider,
'region' => self::SIGV4TEST_REGION,
'service' => self::SIGV4TEST_SERVICE,
'date' => self::SIGV4TEST_DATE(),
]);
$http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']);
$this->assertNotNull($http_request, "Unable to create HttpRequest for signing");
$signable = Signable::fromHttpRequest($http_request);
$this->assertNotNull($signable, "Unable to create signable from HttpRequest");
Signing::signRequestAws(
$signable, $signing_config,
function($signing_result, $error_code) use (&$http_request) {
$this->assertEquals(0, $error_code);
$signing_result->applyToHttpRequest($http_request);
}
);
$headers = $http_request->headers();
$auth_header_value = $headers->get('Authorization');
$this->assertNotNull($auth_header_value);
$this->assertStringStartsWith(
'AWS4-ECDSA-P256-SHA256 Credential=AKIDEXAMPLE/20150830/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-region-set, Signature=',
$auth_header_value);
$this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date'));
}
}

View file

@ -1,34 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\IO\InputStream as InputStream;
require_once('common.inc');
final class InputStreamTest extends CrtTestCase {
const MEM_STREAM_CONTENTS = "THIS IS A TEST";
private function getMemoryStream() {
$stream = fopen("php://memory", 'r+');
fputs($stream, self::MEM_STREAM_CONTENTS);
rewind($stream);
return $stream;
}
public function testMemoryStream() {
$mem_stream = $this->getMemoryStream();
$stream = new InputStream($mem_stream);
$this->assertNotNull($stream, "Failed to create InputStream from PHP memory stream");
$this->assertEquals(strlen(self::MEM_STREAM_CONTENTS), $stream->length(), "Stream length doesn't match source buffer");
$this->assertEquals(self::MEM_STREAM_CONTENTS, $stream->read(), "Stream doesn't match source buffer");
$this->assertTrue($stream->eof(), "Stream is not EOF after reading");
$this->assertEquals(0, $stream->seek(0, InputStream::SEEK_BEGIN), "Unable to rewind stream");
$this->assertFalse($stream->eof(), "Stream is EOF after rewinding");
$this->assertEquals(0, $stream->seek(0, InputStream::SEEK_END), "Unable to seek to end of stream");
$this->assertTrue($stream->eof(), "Stream is not EOF after seeking to end");
$stream = null;
}
}

View file

@ -1,34 +0,0 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use AWS\CRT\CRT as CRT;
ini_set("memory_limit", "512M");
abstract class CrtTestCase extends PHPUnit_Framework_TestCase {
private static $crt = null;
public static function setUpBeforeClass() {
self::$crt = new CRT();
}
public static function tearDownAfterClass() {
self::$crt = null;
}
// Ensure that after every test there are no errors in the CRT itself
protected function assertPostConditions() {
if (CRT::last_error()) {
$this->fail("Test left an error on the stack: " . CRT::error_name(CRT::last_error()));
}
}
// Shim missing calls in older versions of PHPUnit
public function __call($name, $arguments) {
// shim expectException -> setExpectedException for PHPUnit 4.8.x
if ($name == 'expectException') {
$this->setExpectedException($arguments[0]);
}
}
}

View file

@ -16,15 +16,16 @@
"issues": "https://github.com/aws/aws-sdk-php/issues" "issues": "https://github.com/aws/aws-sdk-php/issues"
}, },
"require": { "require": {
"php": ">=5.5", "php": ">=7.2.5",
"guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5",
"guzzlehttp/psr7": "^1.8.5 || ^2.3", "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"guzzlehttp/promises": "^1.4.0", "guzzlehttp/promises": "^1.4.0 || ^2.0",
"mtdowling/jmespath.php": "^2.6", "mtdowling/jmespath.php": "^2.6",
"ext-pcre": "*", "ext-pcre": "*",
"ext-json": "*", "ext-json": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"aws/aws-crt-php": "^1.0.4" "aws/aws-crt-php": "^1.2.3",
"psr/http-message": "^1.0 || ^2.0"
}, },
"require-dev": { "require-dev": {
"composer/composer" : "^1.10.22", "composer/composer" : "^1.10.22",
@ -32,7 +33,7 @@
"ext-dom": "*", "ext-dom": "*",
"ext-pcntl": "*", "ext-pcntl": "*",
"ext-sockets": "*", "ext-sockets": "*",
"phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5", "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
"behat/behat": "~3.0", "behat/behat": "~3.0",
"doctrine/cache": "~1.4", "doctrine/cache": "~1.4",
"aws/aws-php-sns-message-validator": "~1.0", "aws/aws-php-sns-message-validator": "~1.0",

View file

@ -7,14 +7,24 @@ use Aws\AwsClient;
* This client is used to interact with the **AWS ARC - Zonal Shift** service. * This client is used to interact with the **AWS ARC - Zonal Shift** service.
* @method \Aws\Result cancelZonalShift(array $args = []) * @method \Aws\Result cancelZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelZonalShiftAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise cancelZonalShiftAsync(array $args = [])
* @method \Aws\Result createPracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result deletePracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result getManagedResource(array $args = []) * @method \Aws\Result getManagedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getManagedResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getManagedResourceAsync(array $args = [])
* @method \Aws\Result listAutoshifts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAutoshiftsAsync(array $args = [])
* @method \Aws\Result listManagedResources(array $args = []) * @method \Aws\Result listManagedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listManagedResourcesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listManagedResourcesAsync(array $args = [])
* @method \Aws\Result listZonalShifts(array $args = []) * @method \Aws\Result listZonalShifts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listZonalShiftsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listZonalShiftsAsync(array $args = [])
* @method \Aws\Result startZonalShift(array $args = []) * @method \Aws\Result startZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise startZonalShiftAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startZonalShiftAsync(array $args = [])
* @method \Aws\Result updatePracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result updateZonalAutoshiftConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateZonalAutoshiftConfigurationAsync(array $args = [])
* @method \Aws\Result updateZonalShift(array $args = []) * @method \Aws\Result updateZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateZonalShiftAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateZonalShiftAsync(array $args = [])
*/ */

View file

@ -9,6 +9,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise applyArchiveRuleAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise applyArchiveRuleAsync(array $args = [])
* @method \Aws\Result cancelPolicyGeneration(array $args = []) * @method \Aws\Result cancelPolicyGeneration(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelPolicyGenerationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise cancelPolicyGenerationAsync(array $args = [])
* @method \Aws\Result checkAccessNotGranted(array $args = [])
* @method \GuzzleHttp\Promise\Promise checkAccessNotGrantedAsync(array $args = [])
* @method \Aws\Result checkNoNewAccess(array $args = [])
* @method \GuzzleHttp\Promise\Promise checkNoNewAccessAsync(array $args = [])
* @method \Aws\Result createAccessPreview(array $args = []) * @method \Aws\Result createAccessPreview(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAccessPreviewAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createAccessPreviewAsync(array $args = [])
* @method \Aws\Result createAnalyzer(array $args = []) * @method \Aws\Result createAnalyzer(array $args = [])
@ -29,6 +33,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getArchiveRuleAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getArchiveRuleAsync(array $args = [])
* @method \Aws\Result getFinding(array $args = []) * @method \Aws\Result getFinding(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getFindingAsync(array $args = [])
* @method \Aws\Result getFindingV2(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingV2Async(array $args = [])
* @method \Aws\Result getGeneratedPolicy(array $args = []) * @method \Aws\Result getGeneratedPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGeneratedPolicyAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getGeneratedPolicyAsync(array $args = [])
* @method \Aws\Result listAccessPreviewFindings(array $args = []) * @method \Aws\Result listAccessPreviewFindings(array $args = [])
@ -43,6 +49,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listArchiveRulesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listArchiveRulesAsync(array $args = [])
* @method \Aws\Result listFindings(array $args = []) * @method \Aws\Result listFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFindingsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listFindingsAsync(array $args = [])
* @method \Aws\Result listFindingsV2(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFindingsV2Async(array $args = [])
* @method \Aws\Result listPolicyGenerations(array $args = []) * @method \Aws\Result listPolicyGenerations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPolicyGenerationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listPolicyGenerationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = []) * @method \Aws\Result listTagsForResource(array $args = [])

View file

@ -25,6 +25,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise exportFormsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise exportFormsAsync(array $args = [])
* @method \Aws\Result exportThemes(array $args = []) * @method \Aws\Result exportThemes(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportThemesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise exportThemesAsync(array $args = [])
* @method \Aws\Result getCodegenJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCodegenJobAsync(array $args = [])
* @method \Aws\Result getComponent(array $args = []) * @method \Aws\Result getComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise getComponentAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getComponentAsync(array $args = [])
* @method \Aws\Result getForm(array $args = []) * @method \Aws\Result getForm(array $args = [])
@ -33,6 +35,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getMetadataAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getMetadataAsync(array $args = [])
* @method \Aws\Result getTheme(array $args = []) * @method \Aws\Result getTheme(array $args = [])
* @method \GuzzleHttp\Promise\Promise getThemeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getThemeAsync(array $args = [])
* @method \Aws\Result listCodegenJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCodegenJobsAsync(array $args = [])
* @method \Aws\Result listComponents(array $args = []) * @method \Aws\Result listComponents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listComponentsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listComponentsAsync(array $args = [])
* @method \Aws\Result listForms(array $args = []) * @method \Aws\Result listForms(array $args = [])
@ -43,6 +47,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise putMetadataFlagAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putMetadataFlagAsync(array $args = [])
* @method \Aws\Result refreshToken(array $args = []) * @method \Aws\Result refreshToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise refreshTokenAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise refreshTokenAsync(array $args = [])
* @method \Aws\Result startCodegenJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startCodegenJobAsync(array $args = [])
* @method \Aws\Result updateComponent(array $args = []) * @method \Aws\Result updateComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateComponentAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateComponentAsync(array $args = [])
* @method \Aws\Result updateForm(array $args = []) * @method \Aws\Result updateForm(array $args = [])

View file

@ -16,7 +16,7 @@ trait JsonParserTrait
{ {
$code = (string) $response->getStatusCode(); $code = (string) $response->getStatusCode();
if ($this->api if ($this->api
&& $this->api->getMetadata('awsQueryCompatible') && !is_null($this->api->getMetadata('awsQueryCompatible'))
&& $response->getHeaderLine('x-amzn-query-error') && $response->getHeaderLine('x-amzn-query-error')
) { ) {
$queryError = $response->getHeaderLine('x-amzn-query-error'); $queryError = $response->getHeaderLine('x-amzn-query-error');

View file

@ -69,37 +69,81 @@ class EventParsingIterator implements Iterator
if ($event['headers'][':message-type'] === 'error') { if ($event['headers'][':message-type'] === 'error') {
return $this->parseError($event); return $this->parseError($event);
} }
if ($event['headers'][':message-type'] !== 'event') { if ($event['headers'][':message-type'] !== 'event') {
throw new ParserException('Failed to parse unknown message type.'); throw new ParserException('Failed to parse unknown message type.');
} }
} }
if (empty($event['headers'][':event-type'])) { $eventType = $event['headers'][':event-type'] ?? null;
if (empty($eventType)) {
throw new ParserException('Failed to parse without event type.'); throw new ParserException('Failed to parse without event type.');
} }
$eventShape = $this->shape->getMember($event['headers'][':event-type']);
$parsedEvent = []; $eventShape = $this->shape->getMember($eventType);
foreach ($eventShape['members'] as $shape => $details) { $eventPayload = $event['payload'];
if (!empty($details['eventpayload'])) {
$payloadShape = $eventShape->getMember($shape); return [
if ($payloadShape['type'] === 'blob') { $eventType => array_merge(
$parsedEvent[$shape] = $event['payload']; $this->parseEventHeaders($event['headers'], $eventShape),
} else { $this->parseEventPayload($eventPayload, $eventShape)
$parsedEvent[$shape] = $this->parser->parseMemberFromStream( )
$event['payload'], ];
$payloadShape, }
null
); /**
} * @param $headers
} else { * @param $eventShape
$parsedEvent[$shape] = $event['headers'][$shape]; *
* @return array
*/
private function parseEventHeaders($headers, $eventShape): array
{
$parsedHeaders = [];
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
if (isset($memberProps['eventheader'])) {
$parsedHeaders[$memberName] = $headers[$memberName];
} }
} }
return [ return $parsedHeaders;
$event['headers'][':event-type'] => $parsedEvent }
];
/**
* @param $payload
* @param $eventShape
*
* @return array
*/
private function parseEventPayload($payload, $eventShape): array
{
$parsedPayload = [];
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
$memberShape = $eventShape->getMember($memberName);
if (isset($memberProps['eventpayload'])) {
if ($memberShape->getType() === 'blob') {
$parsedPayload[$memberName] = $payload;
} else {
$parsedPayload[$memberName] = $this->parser->parseMemberFromStream(
$payload,
$memberShape,
null
);
}
break;
}
}
if (empty($parsedPayload) && !empty($payload->getContents())) {
/**
* If we did not find a member with an eventpayload trait, then we should deserialize the payload
* using the event's shape.
*/
$parsedPayload = $this->parser->parseMemberFromStream($payload, $eventShape, null);
}
return $parsedPayload;
} }
private function parseError(array $event) private function parseError(array $event)
@ -109,4 +153,4 @@ class EventParsingIterator implements Iterator
$event['headers'][':error-message'] $event['headers'][':error-message']
); );
} }
} }

View file

@ -3,8 +3,8 @@ namespace Aws\Api\Serializer;
use Aws\Api\Service; use Aws\Api\Service;
use Aws\CommandInterface; use Aws\CommandInterface;
use Aws\EndpointV2\EndpointProviderV2;
use Aws\EndpointV2\EndpointV2SerializerTrait; use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface; use Psr\Http\Message\RequestInterface;
@ -56,8 +56,7 @@ class JsonRpcSerializer
*/ */
public function __invoke( public function __invoke(
CommandInterface $command, CommandInterface $command,
$endpointProvider = null, $endpoint = null
$clientArgs = null
) )
{ {
$operationName = $command->getName(); $operationName = $command->getName();
@ -68,15 +67,8 @@ class JsonRpcSerializer
'Content-Type' => $this->contentType 'Content-Type' => $this->contentType
]; ];
if ($endpointProvider instanceof EndpointProviderV2) { if ($endpoint instanceof RulesetEndpoint) {
$this->setRequestOptions( $this->setEndpointV2RequestOptions($endpoint, $headers);
$endpointProvider,
$command,
$operation,
$commandArgs,
$clientArgs,
$headers
);
} }
return new Request( return new Request(

View file

@ -5,6 +5,7 @@ use Aws\Api\Service;
use Aws\CommandInterface; use Aws\CommandInterface;
use Aws\EndpointV2\EndpointProviderV2; use Aws\EndpointV2\EndpointProviderV2;
use Aws\EndpointV2\EndpointV2SerializerTrait; use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface; use Psr\Http\Message\RequestInterface;
@ -42,8 +43,7 @@ class QuerySerializer
*/ */
public function __invoke( public function __invoke(
CommandInterface $command, CommandInterface $command,
$endpointProvider = null, $endpoint = null
$clientArgs = null
) )
{ {
$operation = $this->api->getOperation($command->getName()); $operation = $this->api->getOperation($command->getName());
@ -67,15 +67,8 @@ class QuerySerializer
'Content-Type' => 'application/x-www-form-urlencoded' 'Content-Type' => 'application/x-www-form-urlencoded'
]; ];
if ($endpointProvider instanceof EndpointProviderV2) { if ($endpoint instanceof RulesetEndpoint) {
$this->setRequestOptions( $this->setEndpointV2RequestOptions($endpoint, $headers);
$endpointProvider,
$command,
$operation,
$commandArgs,
$clientArgs,
$headers
);
} }
return new Request( return new Request(

View file

@ -10,6 +10,7 @@ use Aws\Api\TimestampShape;
use Aws\CommandInterface; use Aws\CommandInterface;
use Aws\EndpointV2\EndpointProviderV2; use Aws\EndpointV2\EndpointProviderV2;
use Aws\EndpointV2\EndpointV2SerializerTrait; use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use GuzzleHttp\Psr7; use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Uri; use GuzzleHttp\Psr7\Uri;
@ -49,8 +50,7 @@ abstract class RestSerializer
*/ */
public function __invoke( public function __invoke(
CommandInterface $command, CommandInterface $command,
$endpointProvider = null, $endpoint = null
$clientArgs = null
) )
{ {
$operation = $this->api->getOperation($command->getName()); $operation = $this->api->getOperation($command->getName());
@ -58,17 +58,10 @@ abstract class RestSerializer
$opts = $this->serialize($operation, $commandArgs); $opts = $this->serialize($operation, $commandArgs);
$headers = isset($opts['headers']) ? $opts['headers'] : []; $headers = isset($opts['headers']) ? $opts['headers'] : [];
if ($endpointProvider instanceof EndpointProviderV2) { if ($endpoint instanceof RulesetEndpoint) {
$this->setRequestOptions( $this->setEndpointV2RequestOptions($endpoint, $headers);
$endpointProvider,
$command,
$operation,
$commandArgs,
$clientArgs,
$headers
);
$this->endpoint = new Uri($this->endpoint);
} }
$uri = $this->buildEndpoint($operation, $commandArgs, $opts); $uri = $this->buildEndpoint($operation, $commandArgs, $opts);
return new Request( return new Request(
@ -242,14 +235,24 @@ abstract class RestSerializer
$path = rtrim($path, '/'); $path = rtrim($path, '/');
} }
$relative = $path . $relative; $relative = $path . $relative;
if (strpos($relative, '../') !== false
|| substr($relative, -2) === '..'
) {
if ($relative[0] !== '/') {
$relative = '/' . $relative;
}
return new Uri($this->endpoint->withPath('') . $relative);
}
} }
// If endpoint has path, remove leading '/' to preserve URI resolution. // If endpoint has path, remove leading '/' to preserve URI resolution.
if ($path && $relative[0] === '/') { if ($path && $relative[0] === '/') {
$relative = substr($relative, 1); $relative = substr($relative, 1);
} }
//Append path to endpoint when leading '//...' present //Append path to endpoint when leading '//...'
// as uri cannot be properly resolved // present as uri cannot be properly resolved
if ($this->api->isModifiedModel() if ($this->api->isModifiedModel()
&& strpos($relative, '//') === 0 && strpos($relative, '//') === 0
) { ) {

View file

@ -1,10 +1,6 @@
<?php <?php
namespace Aws\Api; namespace Aws\Api;
use Aws\Api\Serializer\QuerySerializer;
use Aws\Api\Serializer\Ec2ParamBuilder;
use Aws\Api\Parser\QueryParser;
/** /**
* Represents a web service API model. * Represents a web service API model.
*/ */
@ -87,10 +83,10 @@ class Service extends AbstractModel
public static function createSerializer(Service $api, $endpoint) public static function createSerializer(Service $api, $endpoint)
{ {
static $mapping = [ static $mapping = [
'json' => 'Aws\Api\Serializer\JsonRpcSerializer', 'json' => Serializer\JsonRpcSerializer::class,
'query' => 'Aws\Api\Serializer\QuerySerializer', 'query' => Serializer\QuerySerializer::class,
'rest-json' => 'Aws\Api\Serializer\RestJsonSerializer', 'rest-json' => Serializer\RestJsonSerializer::class,
'rest-xml' => 'Aws\Api\Serializer\RestXmlSerializer' 'rest-xml' => Serializer\RestXmlSerializer::class
]; ];
$proto = $api->getProtocol(); $proto = $api->getProtocol();
@ -100,7 +96,7 @@ class Service extends AbstractModel
} }
if ($proto == 'ec2') { if ($proto == 'ec2') {
return new QuerySerializer($api, $endpoint, new Ec2ParamBuilder()); return new Serializer\QuerySerializer($api, $endpoint, new Serializer\Ec2ParamBuilder());
} }
throw new \UnexpectedValueException( throw new \UnexpectedValueException(
@ -121,11 +117,11 @@ class Service extends AbstractModel
public static function createErrorParser($protocol, Service $api = null) public static function createErrorParser($protocol, Service $api = null)
{ {
static $mapping = [ static $mapping = [
'json' => 'Aws\Api\ErrorParser\JsonRpcErrorParser', 'json' => ErrorParser\JsonRpcErrorParser::class,
'query' => 'Aws\Api\ErrorParser\XmlErrorParser', 'query' => ErrorParser\XmlErrorParser::class,
'rest-json' => 'Aws\Api\ErrorParser\RestJsonErrorParser', 'rest-json' => ErrorParser\RestJsonErrorParser::class,
'rest-xml' => 'Aws\Api\ErrorParser\XmlErrorParser', 'rest-xml' => ErrorParser\XmlErrorParser::class,
'ec2' => 'Aws\Api\ErrorParser\XmlErrorParser' 'ec2' => ErrorParser\XmlErrorParser::class
]; ];
if (isset($mapping[$protocol])) { if (isset($mapping[$protocol])) {
@ -145,10 +141,10 @@ class Service extends AbstractModel
public static function createParser(Service $api) public static function createParser(Service $api)
{ {
static $mapping = [ static $mapping = [
'json' => 'Aws\Api\Parser\JsonRpcParser', 'json' => Parser\JsonRpcParser::class,
'query' => 'Aws\Api\Parser\QueryParser', 'query' => Parser\QueryParser::class,
'rest-json' => 'Aws\Api\Parser\RestJsonParser', 'rest-json' => Parser\RestJsonParser::class,
'rest-xml' => 'Aws\Api\Parser\RestXmlParser' 'rest-xml' => Parser\RestXmlParser::class
]; ];
$proto = $api->getProtocol(); $proto = $api->getProtocol();
@ -157,7 +153,7 @@ class Service extends AbstractModel
} }
if ($proto == 'ec2') { if ($proto == 'ec2') {
return new QueryParser($api, null, false); return new Parser\QueryParser($api, null, false);
} }
throw new \UnexpectedValueException( throw new \UnexpectedValueException(

View file

@ -18,19 +18,19 @@ class Shape extends AbstractModel
public static function create(array $definition, ShapeMap $shapeMap) public static function create(array $definition, ShapeMap $shapeMap)
{ {
static $map = [ static $map = [
'structure' => 'Aws\Api\StructureShape', 'structure' => StructureShape::class,
'map' => 'Aws\Api\MapShape', 'map' => MapShape::class,
'list' => 'Aws\Api\ListShape', 'list' => ListShape::class,
'timestamp' => 'Aws\Api\TimestampShape', 'timestamp' => TimestampShape::class,
'integer' => 'Aws\Api\Shape', 'integer' => Shape::class,
'double' => 'Aws\Api\Shape', 'double' => Shape::class,
'float' => 'Aws\Api\Shape', 'float' => Shape::class,
'long' => 'Aws\Api\Shape', 'long' => Shape::class,
'string' => 'Aws\Api\Shape', 'string' => Shape::class,
'byte' => 'Aws\Api\Shape', 'byte' => Shape::class,
'character' => 'Aws\Api\Shape', 'character' => Shape::class,
'blob' => 'Aws\Api\Shape', 'blob' => Shape::class,
'boolean' => 'Aws\Api\Shape' 'boolean' => Shape::class
]; ];
if (isset($definition['shape'])) { if (isset($definition['shape'])) {

View file

@ -24,7 +24,7 @@ class TimestampShape extends Shape
*/ */
public static function format($value, $format) public static function format($value, $format)
{ {
if ($value instanceof \DateTime) { if ($value instanceof \DateTimeInterface) {
$value = $value->getTimestamp(); $value = $value->getTimestamp();
} elseif (is_string($value)) { } elseif (is_string($value)) {
$value = strtotime($value); $value = strtotime($value);

View file

@ -0,0 +1,61 @@
<?php
namespace Aws\AppFabric;
use Aws\AwsClient;
/**
* This client is used to interact with the **AppFabric** service.
* @method \Aws\Result batchGetUserAccessTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchGetUserAccessTasksAsync(array $args = [])
* @method \Aws\Result connectAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise connectAppAuthorizationAsync(array $args = [])
* @method \Aws\Result createAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppAuthorizationAsync(array $args = [])
* @method \Aws\Result createAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppBundleAsync(array $args = [])
* @method \Aws\Result createIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIngestionAsync(array $args = [])
* @method \Aws\Result createIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIngestionDestinationAsync(array $args = [])
* @method \Aws\Result deleteAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppAuthorizationAsync(array $args = [])
* @method \Aws\Result deleteAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppBundleAsync(array $args = [])
* @method \Aws\Result deleteIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIngestionAsync(array $args = [])
* @method \Aws\Result deleteIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIngestionDestinationAsync(array $args = [])
* @method \Aws\Result getAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAppAuthorizationAsync(array $args = [])
* @method \Aws\Result getAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAppBundleAsync(array $args = [])
* @method \Aws\Result getIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIngestionAsync(array $args = [])
* @method \Aws\Result getIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIngestionDestinationAsync(array $args = [])
* @method \Aws\Result listAppAuthorizations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAppAuthorizationsAsync(array $args = [])
* @method \Aws\Result listAppBundles(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAppBundlesAsync(array $args = [])
* @method \Aws\Result listIngestionDestinations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listIngestionDestinationsAsync(array $args = [])
* @method \Aws\Result listIngestions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listIngestionsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise startIngestionAsync(array $args = [])
* @method \Aws\Result startUserAccessTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise startUserAccessTasksAsync(array $args = [])
* @method \Aws\Result stopIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopIngestionAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAppAuthorizationAsync(array $args = [])
* @method \Aws\Result updateIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIngestionDestinationAsync(array $args = [])
*/
class AppFabricClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppFabric\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AppFabric** service.
*/
class AppFabricException extends AwsException {}

View file

@ -5,18 +5,28 @@ use Aws\AwsClient;
/** /**
* This client is used to interact with the **Amazon AppIntegrations Service** service. * This client is used to interact with the **Amazon AppIntegrations Service** service.
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createDataIntegration(array $args = []) * @method \Aws\Result createDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createDataIntegrationAsync(array $args = [])
* @method \Aws\Result createEventIntegration(array $args = []) * @method \Aws\Result createEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEventIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createEventIntegrationAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteDataIntegration(array $args = []) * @method \Aws\Result deleteDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteDataIntegrationAsync(array $args = [])
* @method \Aws\Result deleteEventIntegration(array $args = []) * @method \Aws\Result deleteEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEventIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteEventIntegrationAsync(array $args = [])
* @method \Aws\Result getApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApplicationAsync(array $args = [])
* @method \Aws\Result getDataIntegration(array $args = []) * @method \Aws\Result getDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getDataIntegrationAsync(array $args = [])
* @method \Aws\Result getEventIntegration(array $args = []) * @method \Aws\Result getEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEventIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getEventIntegrationAsync(array $args = [])
* @method \Aws\Result listApplicationAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationAssociationsAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listDataIntegrationAssociations(array $args = []) * @method \Aws\Result listDataIntegrationAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataIntegrationAssociationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listDataIntegrationAssociationsAsync(array $args = [])
* @method \Aws\Result listDataIntegrations(array $args = []) * @method \Aws\Result listDataIntegrations(array $args = [])
@ -31,6 +41,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateDataIntegration(array $args = []) * @method \Aws\Result updateDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataIntegrationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateDataIntegrationAsync(array $args = [])
* @method \Aws\Result updateEventIntegration(array $args = []) * @method \Aws\Result updateEventIntegration(array $args = [])

View file

@ -55,6 +55,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listOperationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listOperationsAsync(array $args = [])
* @method \Aws\Result listServices(array $args = []) * @method \Aws\Result listServices(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServicesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listServicesAsync(array $args = [])
* @method \Aws\Result listServicesForAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServicesForAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = []) * @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listVpcConnectors(array $args = []) * @method \Aws\Result listVpcConnectors(array $args = [])
@ -71,6 +73,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateDefaultAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDefaultAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result updateService(array $args = []) * @method \Aws\Result updateService(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateServiceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateServiceAsync(array $args = [])
* @method \Aws\Result updateVpcIngressConnection(array $args = []) * @method \Aws\Result updateVpcIngressConnection(array $args = [])

View file

@ -7,6 +7,10 @@ use Aws\AwsClient;
* This client is used to interact with the **AWS AppSync** service. * This client is used to interact with the **AWS AppSync** service.
* @method \Aws\Result associateApi(array $args = []) * @method \Aws\Result associateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateApiAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise associateApiAsync(array $args = [])
* @method \Aws\Result associateMergedGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateMergedGraphqlApiAsync(array $args = [])
* @method \Aws\Result associateSourceGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSourceGraphqlApiAsync(array $args = [])
* @method \Aws\Result createApiCache(array $args = []) * @method \Aws\Result createApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiCacheAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createApiCacheAsync(array $args = [])
* @method \Aws\Result createApiKey(array $args = []) * @method \Aws\Result createApiKey(array $args = [])
@ -41,6 +45,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteTypeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteTypeAsync(array $args = [])
* @method \Aws\Result disassociateApi(array $args = []) * @method \Aws\Result disassociateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateApiAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise disassociateApiAsync(array $args = [])
* @method \Aws\Result disassociateMergedGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateMergedGraphqlApiAsync(array $args = [])
* @method \Aws\Result disassociateSourceGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSourceGraphqlApiAsync(array $args = [])
* @method \Aws\Result evaluateCode(array $args = []) * @method \Aws\Result evaluateCode(array $args = [])
* @method \GuzzleHttp\Promise\Promise evaluateCodeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise evaluateCodeAsync(array $args = [])
* @method \Aws\Result evaluateMappingTemplate(array $args = []) * @method \Aws\Result evaluateMappingTemplate(array $args = [])
@ -53,6 +61,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getApiCacheAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getApiCacheAsync(array $args = [])
* @method \Aws\Result getDataSource(array $args = []) * @method \Aws\Result getDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getDataSourceAsync(array $args = [])
* @method \Aws\Result getDataSourceIntrospection(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceIntrospectionAsync(array $args = [])
* @method \Aws\Result getDomainName(array $args = []) * @method \Aws\Result getDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = [])
* @method \Aws\Result getFunction(array $args = []) * @method \Aws\Result getFunction(array $args = [])
@ -65,6 +75,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getResolverAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getResolverAsync(array $args = [])
* @method \Aws\Result getSchemaCreationStatus(array $args = []) * @method \Aws\Result getSchemaCreationStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSchemaCreationStatusAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getSchemaCreationStatusAsync(array $args = [])
* @method \Aws\Result getSourceApiAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSourceApiAssociationAsync(array $args = [])
* @method \Aws\Result getType(array $args = []) * @method \Aws\Result getType(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTypeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getTypeAsync(array $args = [])
* @method \Aws\Result listApiKeys(array $args = []) * @method \Aws\Result listApiKeys(array $args = [])
@ -81,12 +93,20 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listResolversAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listResolversAsync(array $args = [])
* @method \Aws\Result listResolversByFunction(array $args = []) * @method \Aws\Result listResolversByFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise listResolversByFunctionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listResolversByFunctionAsync(array $args = [])
* @method \Aws\Result listSourceApiAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSourceApiAssociationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = []) * @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listTypes(array $args = []) * @method \Aws\Result listTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTypesAsync(array $args = [])
* @method \Aws\Result listTypesByAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypesByAssociationAsync(array $args = [])
* @method \Aws\Result startDataSourceIntrospection(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDataSourceIntrospectionAsync(array $args = [])
* @method \Aws\Result startSchemaCreation(array $args = []) * @method \Aws\Result startSchemaCreation(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSchemaCreationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startSchemaCreationAsync(array $args = [])
* @method \Aws\Result startSchemaMerge(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSchemaMergeAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = []) * @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
@ -105,6 +125,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateGraphqlApiAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateGraphqlApiAsync(array $args = [])
* @method \Aws\Result updateResolver(array $args = []) * @method \Aws\Result updateResolver(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateResolverAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateResolverAsync(array $args = [])
* @method \Aws\Result updateSourceApiAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateSourceApiAssociationAsync(array $args = [])
* @method \Aws\Result updateType(array $args = []) * @method \Aws\Result updateType(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTypeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateTypeAsync(array $args = [])
*/ */

View file

@ -5,6 +5,8 @@ use Aws\AwsClient;
/** /**
* This client is used to interact with the **Amazon Appflow** service. * This client is used to interact with the **Amazon Appflow** service.
* @method \Aws\Result cancelFlowExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelFlowExecutionsAsync(array $args = [])
* @method \Aws\Result createConnectorProfile(array $args = []) * @method \Aws\Result createConnectorProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createConnectorProfileAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createConnectorProfileAsync(array $args = [])
* @method \Aws\Result createFlow(array $args = []) * @method \Aws\Result createFlow(array $args = [])
@ -35,6 +37,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result registerConnector(array $args = []) * @method \Aws\Result registerConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerConnectorAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise registerConnectorAsync(array $args = [])
* @method \Aws\Result resetConnectorMetadataCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise resetConnectorMetadataCacheAsync(array $args = [])
* @method \Aws\Result startFlow(array $args = []) * @method \Aws\Result startFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise startFlowAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startFlowAsync(array $args = [])
* @method \Aws\Result stopFlow(array $args = []) * @method \Aws\Result stopFlow(array $args = [])

View file

@ -19,11 +19,17 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeScalingPoliciesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeScalingPoliciesAsync(array $args = [])
* @method \Aws\Result describeScheduledActions(array $args = []) * @method \Aws\Result describeScheduledActions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScheduledActionsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeScheduledActionsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putScalingPolicy(array $args = []) * @method \Aws\Result putScalingPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putScalingPolicyAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putScalingPolicyAsync(array $args = [])
* @method \Aws\Result putScheduledAction(array $args = []) * @method \Aws\Result putScheduledAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise putScheduledActionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putScheduledActionAsync(array $args = [])
* @method \Aws\Result registerScalableTarget(array $args = []) * @method \Aws\Result registerScalableTarget(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerScalableTargetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise registerScalableTargetAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
*/ */
class ApplicationAutoScalingClient extends AwsClient {} class ApplicationAutoScalingClient extends AwsClient {}

View file

@ -7,6 +7,8 @@ use Aws\AwsClient;
* This client is used to interact with the **AWS Application Discovery Service** service. * This client is used to interact with the **AWS Application Discovery Service** service.
* @method \Aws\Result associateConfigurationItemsToApplication(array $args = []) * @method \Aws\Result associateConfigurationItemsToApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateConfigurationItemsToApplicationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise associateConfigurationItemsToApplicationAsync(array $args = [])
* @method \Aws\Result batchDeleteAgents(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteAgentsAsync(array $args = [])
* @method \Aws\Result batchDeleteImportData(array $args = []) * @method \Aws\Result batchDeleteImportData(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteImportDataAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise batchDeleteImportDataAsync(array $args = [])
* @method \Aws\Result createApplication(array $args = []) * @method \Aws\Result createApplication(array $args = [])
@ -19,6 +21,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteTagsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteTagsAsync(array $args = [])
* @method \Aws\Result describeAgents(array $args = []) * @method \Aws\Result describeAgents(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAgentsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeAgentsAsync(array $args = [])
* @method \Aws\Result describeBatchDeleteConfigurationTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBatchDeleteConfigurationTaskAsync(array $args = [])
* @method \Aws\Result describeConfigurations(array $args = []) * @method \Aws\Result describeConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConfigurationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeConfigurationsAsync(array $args = [])
* @method \Aws\Result describeContinuousExports(array $args = []) * @method \Aws\Result describeContinuousExports(array $args = [])
@ -41,6 +45,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listConfigurationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listConfigurationsAsync(array $args = [])
* @method \Aws\Result listServerNeighbors(array $args = []) * @method \Aws\Result listServerNeighbors(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServerNeighborsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listServerNeighborsAsync(array $args = [])
* @method \Aws\Result startBatchDeleteConfigurationTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise startBatchDeleteConfigurationTaskAsync(array $args = [])
* @method \Aws\Result startContinuousExport(array $args = []) * @method \Aws\Result startContinuousExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise startContinuousExportAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startContinuousExportAsync(array $args = [])
* @method \Aws\Result startDataCollectionByAgentIds(array $args = []) * @method \Aws\Result startDataCollectionByAgentIds(array $args = [])

View file

@ -5,6 +5,8 @@ use Aws\AwsClient;
/** /**
* This client is used to interact with the **Amazon CloudWatch Application Insights** service. * This client is used to interact with the **Amazon CloudWatch Application Insights** service.
* @method \Aws\Result addWorkload(array $args = [])
* @method \GuzzleHttp\Promise\Promise addWorkloadAsync(array $args = [])
* @method \Aws\Result createApplication(array $args = []) * @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createComponent(array $args = []) * @method \Aws\Result createComponent(array $args = [])
@ -33,6 +35,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeProblemAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeProblemAsync(array $args = [])
* @method \Aws\Result describeProblemObservations(array $args = []) * @method \Aws\Result describeProblemObservations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeProblemObservationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeProblemObservationsAsync(array $args = [])
* @method \Aws\Result describeWorkload(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeWorkloadAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = []) * @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listComponents(array $args = []) * @method \Aws\Result listComponents(array $args = [])
@ -47,6 +51,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listProblemsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listProblemsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = []) * @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listWorkloads(array $args = [])
* @method \GuzzleHttp\Promise\Promise listWorkloadsAsync(array $args = [])
* @method \Aws\Result removeWorkload(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeWorkloadAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = []) * @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
@ -59,5 +67,9 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateComponentConfigurationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateComponentConfigurationAsync(array $args = [])
* @method \Aws\Result updateLogPattern(array $args = []) * @method \Aws\Result updateLogPattern(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateLogPatternAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateLogPatternAsync(array $args = [])
* @method \Aws\Result updateProblem(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateProblemAsync(array $args = [])
* @method \Aws\Result updateWorkload(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateWorkloadAsync(array $args = [])
*/ */
class ApplicationInsightsClient extends AwsClient {} class ApplicationInsightsClient extends AwsClient {}

View file

@ -5,6 +5,8 @@ use Aws\AwsClient;
/** /**
* This client is used to interact with the **Amazon AppStream** service. * This client is used to interact with the **Amazon AppStream** service.
* @method \Aws\Result associateAppBlockBuilderAppBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateAppBlockBuilderAppBlockAsync(array $args = [])
* @method \Aws\Result associateApplicationFleet(array $args = []) * @method \Aws\Result associateApplicationFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateApplicationFleetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise associateApplicationFleetAsync(array $args = [])
* @method \Aws\Result associateApplicationToEntitlement(array $args = []) * @method \Aws\Result associateApplicationToEntitlement(array $args = [])
@ -19,6 +21,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise copyImageAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise copyImageAsync(array $args = [])
* @method \Aws\Result createAppBlock(array $args = []) * @method \Aws\Result createAppBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppBlockAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createAppBlockAsync(array $args = [])
* @method \Aws\Result createAppBlockBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppBlockBuilderAsync(array $args = [])
* @method \Aws\Result createAppBlockBuilderStreamingURL(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppBlockBuilderStreamingURLAsync(array $args = [])
* @method \Aws\Result createApplication(array $args = []) * @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createDirectoryConfig(array $args = []) * @method \Aws\Result createDirectoryConfig(array $args = [])
@ -43,6 +49,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = [])
* @method \Aws\Result deleteAppBlock(array $args = []) * @method \Aws\Result deleteAppBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppBlockAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteAppBlockAsync(array $args = [])
* @method \Aws\Result deleteAppBlockBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppBlockBuilderAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = []) * @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteDirectoryConfig(array $args = []) * @method \Aws\Result deleteDirectoryConfig(array $args = [])
@ -63,6 +71,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteUsageReportSubscriptionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteUsageReportSubscriptionAsync(array $args = [])
* @method \Aws\Result deleteUser(array $args = []) * @method \Aws\Result deleteUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUserAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteUserAsync(array $args = [])
* @method \Aws\Result describeAppBlockBuilderAppBlockAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAppBlockBuilderAppBlockAssociationsAsync(array $args = [])
* @method \Aws\Result describeAppBlockBuilders(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAppBlockBuildersAsync(array $args = [])
* @method \Aws\Result describeAppBlocks(array $args = []) * @method \Aws\Result describeAppBlocks(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAppBlocksAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeAppBlocksAsync(array $args = [])
* @method \Aws\Result describeApplicationFleetAssociations(array $args = []) * @method \Aws\Result describeApplicationFleetAssociations(array $args = [])
@ -93,6 +105,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeUsersAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeUsersAsync(array $args = [])
* @method \Aws\Result disableUser(array $args = []) * @method \Aws\Result disableUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise disableUserAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise disableUserAsync(array $args = [])
* @method \Aws\Result disassociateAppBlockBuilderAppBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateAppBlockBuilderAppBlockAsync(array $args = [])
* @method \Aws\Result disassociateApplicationFleet(array $args = []) * @method \Aws\Result disassociateApplicationFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateApplicationFleetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise disassociateApplicationFleetAsync(array $args = [])
* @method \Aws\Result disassociateApplicationFromEntitlement(array $args = []) * @method \Aws\Result disassociateApplicationFromEntitlement(array $args = [])
@ -111,10 +125,14 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listEntitledApplicationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listEntitledApplicationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = []) * @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startAppBlockBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise startAppBlockBuilderAsync(array $args = [])
* @method \Aws\Result startFleet(array $args = []) * @method \Aws\Result startFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise startFleetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startFleetAsync(array $args = [])
* @method \Aws\Result startImageBuilder(array $args = []) * @method \Aws\Result startImageBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise startImageBuilderAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startImageBuilderAsync(array $args = [])
* @method \Aws\Result stopAppBlockBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopAppBlockBuilderAsync(array $args = [])
* @method \Aws\Result stopFleet(array $args = []) * @method \Aws\Result stopFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopFleetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise stopFleetAsync(array $args = [])
* @method \Aws\Result stopImageBuilder(array $args = []) * @method \Aws\Result stopImageBuilder(array $args = [])
@ -123,6 +141,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAppBlockBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAppBlockBuilderAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = []) * @method \Aws\Result updateApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateDirectoryConfig(array $args = []) * @method \Aws\Result updateDirectoryConfig(array $args = [])

View file

@ -11,6 +11,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise batchGetPreparedStatementAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise batchGetPreparedStatementAsync(array $args = [])
* @method \Aws\Result batchGetQueryExecution(array $args = []) * @method \Aws\Result batchGetQueryExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchGetQueryExecutionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise batchGetQueryExecutionAsync(array $args = [])
* @method \Aws\Result cancelCapacityReservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelCapacityReservationAsync(array $args = [])
* @method \Aws\Result createCapacityReservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCapacityReservationAsync(array $args = [])
* @method \Aws\Result createDataCatalog(array $args = []) * @method \Aws\Result createDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataCatalogAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createDataCatalogAsync(array $args = [])
* @method \Aws\Result createNamedQuery(array $args = []) * @method \Aws\Result createNamedQuery(array $args = [])
@ -23,6 +27,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createPresignedNotebookUrlAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createPresignedNotebookUrlAsync(array $args = [])
* @method \Aws\Result createWorkGroup(array $args = []) * @method \Aws\Result createWorkGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createWorkGroupAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createWorkGroupAsync(array $args = [])
* @method \Aws\Result deleteCapacityReservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCapacityReservationAsync(array $args = [])
* @method \Aws\Result deleteDataCatalog(array $args = []) * @method \Aws\Result deleteDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataCatalogAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteDataCatalogAsync(array $args = [])
* @method \Aws\Result deleteNamedQuery(array $args = []) * @method \Aws\Result deleteNamedQuery(array $args = [])
@ -41,6 +47,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getCalculationExecutionCodeAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getCalculationExecutionCodeAsync(array $args = [])
* @method \Aws\Result getCalculationExecutionStatus(array $args = []) * @method \Aws\Result getCalculationExecutionStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCalculationExecutionStatusAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getCalculationExecutionStatusAsync(array $args = [])
* @method \Aws\Result getCapacityAssignmentConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCapacityAssignmentConfigurationAsync(array $args = [])
* @method \Aws\Result getCapacityReservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCapacityReservationAsync(array $args = [])
* @method \Aws\Result getDataCatalog(array $args = []) * @method \Aws\Result getDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataCatalogAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getDataCatalogAsync(array $args = [])
* @method \Aws\Result getDatabase(array $args = []) * @method \Aws\Result getDatabase(array $args = [])
@ -71,6 +81,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listApplicationDPUSizesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listApplicationDPUSizesAsync(array $args = [])
* @method \Aws\Result listCalculationExecutions(array $args = []) * @method \Aws\Result listCalculationExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCalculationExecutionsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listCalculationExecutionsAsync(array $args = [])
* @method \Aws\Result listCapacityReservations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCapacityReservationsAsync(array $args = [])
* @method \Aws\Result listDataCatalogs(array $args = []) * @method \Aws\Result listDataCatalogs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataCatalogsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listDataCatalogsAsync(array $args = [])
* @method \Aws\Result listDatabases(array $args = []) * @method \Aws\Result listDatabases(array $args = [])
@ -97,6 +109,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listWorkGroups(array $args = []) * @method \Aws\Result listWorkGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listWorkGroupsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listWorkGroupsAsync(array $args = [])
* @method \Aws\Result putCapacityAssignmentConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putCapacityAssignmentConfigurationAsync(array $args = [])
* @method \Aws\Result startCalculationExecution(array $args = []) * @method \Aws\Result startCalculationExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise startCalculationExecutionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startCalculationExecutionAsync(array $args = [])
* @method \Aws\Result startQueryExecution(array $args = []) * @method \Aws\Result startQueryExecution(array $args = [])
@ -113,6 +127,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise terminateSessionAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise terminateSessionAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = []) * @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateCapacityReservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateCapacityReservationAsync(array $args = [])
* @method \Aws\Result updateDataCatalog(array $args = []) * @method \Aws\Result updateDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataCatalogAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateDataCatalogAsync(array $args = [])
* @method \Aws\Result updateNamedQuery(array $args = []) * @method \Aws\Result updateNamedQuery(array $args = [])

View file

@ -59,6 +59,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getEvidenceAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getEvidenceAsync(array $args = [])
* @method \Aws\Result getEvidenceByEvidenceFolder(array $args = []) * @method \Aws\Result getEvidenceByEvidenceFolder(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEvidenceByEvidenceFolderAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getEvidenceByEvidenceFolderAsync(array $args = [])
* @method \Aws\Result getEvidenceFileUploadUrl(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEvidenceFileUploadUrlAsync(array $args = [])
* @method \Aws\Result getEvidenceFolder(array $args = []) * @method \Aws\Result getEvidenceFolder(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEvidenceFolderAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getEvidenceFolderAsync(array $args = [])
* @method \Aws\Result getEvidenceFoldersByAssessment(array $args = []) * @method \Aws\Result getEvidenceFoldersByAssessment(array $args = [])

View file

@ -6,6 +6,8 @@ use Aws\Api\DocModel;
use Aws\Api\Service; use Aws\Api\Service;
use Aws\EndpointDiscovery\EndpointDiscoveryMiddleware; use Aws\EndpointDiscovery\EndpointDiscoveryMiddleware;
use Aws\EndpointV2\EndpointProviderV2; use Aws\EndpointV2\EndpointProviderV2;
use Aws\EndpointV2\EndpointV2Middleware;
use Aws\Exception\AwsException;
use Aws\Signature\SignatureProvider; use Aws\Signature\SignatureProvider;
use GuzzleHttp\Psr7\Uri; use GuzzleHttp\Psr7\Uri;
@ -235,10 +237,17 @@ class AwsClient implements AwsClientInterface
$this->addInvocationId(); $this->addInvocationId();
$this->addEndpointParameterMiddleware($args); $this->addEndpointParameterMiddleware($args);
$this->addEndpointDiscoveryMiddleware($config, $args); $this->addEndpointDiscoveryMiddleware($config, $args);
$this->addRequestCompressionMiddleware($config);
$this->loadAliases(); $this->loadAliases();
$this->addStreamRequestPayload(); $this->addStreamRequestPayload();
$this->addRecursionDetection(); $this->addRecursionDetection();
$this->addRequestBuilder(); if ($this->isUseEndpointV2()) {
$this->addEndpointV2Middleware();
}
if (!is_null($this->api->getMetadata('awsQueryCompatible'))) {
$this->addQueryCompatibleInputMiddleware($this->api);
}
if (isset($args['with_resolved'])) { if (isset($args['with_resolved'])) {
$args['with_resolved']($config); $args['with_resolved']($config);
@ -354,7 +363,7 @@ class AwsClient implements AwsClientInterface
$klass = get_class($this); $klass = get_class($this);
if ($klass === __CLASS__) { if ($klass === __CLASS__) {
return ['', 'Aws\Exception\AwsException']; return ['', AwsException::class];
} }
$service = substr($klass, strrpos($klass, '\\') + 1, -6); $service = substr($klass, strrpos($klass, '\\') + 1, -6);
@ -439,11 +448,35 @@ class AwsClient implements AwsClientInterface
return SignatureProvider::resolve($provider, $version, $name, $region); return SignatureProvider::resolve($provider, $version, $name, $region);
}; };
$this->handlerList->appendSign( $this->handlerList->appendSign(
Middleware::signer($this->credentialProvider, $resolver, $this->tokenProvider), Middleware::signer($this->credentialProvider,
$resolver,
$this->tokenProvider,
$this->getConfig()
),
'signer' 'signer'
); );
} }
private function addRequestCompressionMiddleware($config)
{
if (empty($config['disable_request_compression'])) {
$list = $this->getHandlerList();
$list->appendBuild(
RequestCompressionMiddleware::wrap($config),
'request-compression'
);
}
}
private function addQueryCompatibleInputMiddleware(Service $api)
{
$list = $this->getHandlerList();
$list->appendValidate(
QueryCompatibleInputMiddleware::wrap($api),
'query-compatible-input'
);
}
private function addInvocationId() private function addInvocationId()
{ {
// Add invocation id to each request // Add invocation id to each request
@ -486,24 +519,18 @@ class AwsClient implements AwsClientInterface
); );
} }
/** private function addEndpointV2Middleware()
* Adds the `builder` middleware such that a client's endpoint
* provider and endpoint resolution arguments can be passed.
*/
private function addRequestBuilder()
{ {
$handlerList = $this->getHandlerList(); $list = $this->getHandlerList();
$serializer = $this->serializer;
$endpointProvider = $this->endpointProvider;
$endpointArgs = $this->getEndpointProviderArgs(); $endpointArgs = $this->getEndpointProviderArgs();
$handlerList->prependBuild( $list->prependBuild(
Middleware::requestBuilder( EndpointV2Middleware::wrap(
$serializer, $this->endpointProvider,
$endpointProvider, $this->getApi(),
$endpointArgs $endpointArgs
), ),
'builderV2' 'endpoint-resolution'
); );
} }
@ -588,6 +615,25 @@ class AwsClient implements AwsClientInterface
return $this->endpointProvider instanceof EndpointProviderV2; return $this->endpointProvider instanceof EndpointProviderV2;
} }
public static function emitDeprecationWarning() {
$phpVersion = PHP_VERSION_ID;
if ($phpVersion < 70205) {
$phpVersionString = phpversion();
@trigger_error(
"This installation of the SDK is using PHP version"
. " {$phpVersionString}, which will be deprecated on August"
. " 15th, 2023. Please upgrade your PHP version to a minimum of"
. " 7.2.5 before then to continue receiving updates to the AWS"
. " SDK for PHP. To disable this warning, set"
. " suppress_php_deprecation_warning to true on the client constructor"
. " or set the environment variable AWS_SUPPRESS_PHP_DEPRECATION_WARNING"
. " to true.",
E_USER_DEPRECATED
);
}
}
/** /**
* Returns a service model and doc model with any necessary changes * Returns a service model and doc model with any necessary changes
* applied. * applied.

View file

@ -0,0 +1,63 @@
<?php
namespace Aws\B2bi;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS B2B Data Interchange** service.
* @method \Aws\Result createCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCapabilityAsync(array $args = [])
* @method \Aws\Result createPartnership(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPartnershipAsync(array $args = [])
* @method \Aws\Result createProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createProfileAsync(array $args = [])
* @method \Aws\Result createTransformer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTransformerAsync(array $args = [])
* @method \Aws\Result deleteCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCapabilityAsync(array $args = [])
* @method \Aws\Result deletePartnership(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePartnershipAsync(array $args = [])
* @method \Aws\Result deleteProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProfileAsync(array $args = [])
* @method \Aws\Result deleteTransformer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTransformerAsync(array $args = [])
* @method \Aws\Result getCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCapabilityAsync(array $args = [])
* @method \Aws\Result getPartnership(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPartnershipAsync(array $args = [])
* @method \Aws\Result getProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProfileAsync(array $args = [])
* @method \Aws\Result getTransformer(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTransformerAsync(array $args = [])
* @method \Aws\Result getTransformerJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTransformerJobAsync(array $args = [])
* @method \Aws\Result listCapabilities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCapabilitiesAsync(array $args = [])
* @method \Aws\Result listPartnerships(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPartnershipsAsync(array $args = [])
* @method \Aws\Result listProfiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProfilesAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listTransformers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTransformersAsync(array $args = [])
* @method \Aws\Result startTransformerJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startTransformerJobAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result testMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise testMappingAsync(array $args = [])
* @method \Aws\Result testParsing(array $args = [])
* @method \GuzzleHttp\Promise\Promise testParsingAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateCapabilityAsync(array $args = [])
* @method \Aws\Result updatePartnership(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePartnershipAsync(array $args = [])
* @method \Aws\Result updateProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateProfileAsync(array $args = [])
* @method \Aws\Result updateTransformer(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTransformerAsync(array $args = [])
*/
class B2biClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\B2bi\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS B2B Data Interchange** service.
*/
class B2biException extends AwsException {}

View file

@ -0,0 +1,33 @@
<?php
namespace Aws\BCMDataExports;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Billing and Cost Management Data Exports** service.
* @method \Aws\Result createExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise createExportAsync(array $args = [])
* @method \Aws\Result deleteExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteExportAsync(array $args = [])
* @method \Aws\Result getExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise getExecutionAsync(array $args = [])
* @method \Aws\Result getExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise getExportAsync(array $args = [])
* @method \Aws\Result getTable(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTableAsync(array $args = [])
* @method \Aws\Result listExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listExecutionsAsync(array $args = [])
* @method \Aws\Result listExports(array $args = [])
* @method \GuzzleHttp\Promise\Promise listExportsAsync(array $args = [])
* @method \Aws\Result listTables(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTablesAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateExportAsync(array $args = [])
*/
class BCMDataExportsClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\BCMDataExports\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Billing and Cost Management Data Exports** service.
*/
class BCMDataExportsException extends AwsException {}

View file

@ -17,8 +17,14 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createFrameworkAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createFrameworkAsync(array $args = [])
* @method \Aws\Result createLegalHold(array $args = []) * @method \Aws\Result createLegalHold(array $args = [])
* @method \GuzzleHttp\Promise\Promise createLegalHoldAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createLegalHoldAsync(array $args = [])
* @method \Aws\Result createLogicallyAirGappedBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise createLogicallyAirGappedBackupVaultAsync(array $args = [])
* @method \Aws\Result createReportPlan(array $args = []) * @method \Aws\Result createReportPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createReportPlanAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createReportPlanAsync(array $args = [])
* @method \Aws\Result createRestoreTestingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRestoreTestingPlanAsync(array $args = [])
* @method \Aws\Result createRestoreTestingSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRestoreTestingSelectionAsync(array $args = [])
* @method \Aws\Result deleteBackupPlan(array $args = []) * @method \Aws\Result deleteBackupPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupPlanAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteBackupPlanAsync(array $args = [])
* @method \Aws\Result deleteBackupSelection(array $args = []) * @method \Aws\Result deleteBackupSelection(array $args = [])
@ -37,6 +43,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteRecoveryPointAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteRecoveryPointAsync(array $args = [])
* @method \Aws\Result deleteReportPlan(array $args = []) * @method \Aws\Result deleteReportPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteReportPlanAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteReportPlanAsync(array $args = [])
* @method \Aws\Result deleteRestoreTestingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRestoreTestingPlanAsync(array $args = [])
* @method \Aws\Result deleteRestoreTestingSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRestoreTestingSelectionAsync(array $args = [])
* @method \Aws\Result describeBackupJob(array $args = []) * @method \Aws\Result describeBackupJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBackupJobAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeBackupJobAsync(array $args = [])
* @method \Aws\Result describeBackupVault(array $args = []) * @method \Aws\Result describeBackupVault(array $args = [])
@ -81,8 +91,18 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getLegalHoldAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getLegalHoldAsync(array $args = [])
* @method \Aws\Result getRecoveryPointRestoreMetadata(array $args = []) * @method \Aws\Result getRecoveryPointRestoreMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRecoveryPointRestoreMetadataAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getRecoveryPointRestoreMetadataAsync(array $args = [])
* @method \Aws\Result getRestoreJobMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestoreJobMetadataAsync(array $args = [])
* @method \Aws\Result getRestoreTestingInferredMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestoreTestingInferredMetadataAsync(array $args = [])
* @method \Aws\Result getRestoreTestingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestoreTestingPlanAsync(array $args = [])
* @method \Aws\Result getRestoreTestingSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestoreTestingSelectionAsync(array $args = [])
* @method \Aws\Result getSupportedResourceTypes(array $args = []) * @method \Aws\Result getSupportedResourceTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSupportedResourceTypesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getSupportedResourceTypesAsync(array $args = [])
* @method \Aws\Result listBackupJobSummaries(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupJobSummariesAsync(array $args = [])
* @method \Aws\Result listBackupJobs(array $args = []) * @method \Aws\Result listBackupJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupJobsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listBackupJobsAsync(array $args = [])
* @method \Aws\Result listBackupPlanTemplates(array $args = []) * @method \Aws\Result listBackupPlanTemplates(array $args = [])
@ -95,6 +115,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listBackupSelectionsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listBackupSelectionsAsync(array $args = [])
* @method \Aws\Result listBackupVaults(array $args = []) * @method \Aws\Result listBackupVaults(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupVaultsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listBackupVaultsAsync(array $args = [])
* @method \Aws\Result listCopyJobSummaries(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCopyJobSummariesAsync(array $args = [])
* @method \Aws\Result listCopyJobs(array $args = []) * @method \Aws\Result listCopyJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCopyJobsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listCopyJobsAsync(array $args = [])
* @method \Aws\Result listFrameworks(array $args = []) * @method \Aws\Result listFrameworks(array $args = [])
@ -103,6 +125,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listLegalHoldsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listLegalHoldsAsync(array $args = [])
* @method \Aws\Result listProtectedResources(array $args = []) * @method \Aws\Result listProtectedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProtectedResourcesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listProtectedResourcesAsync(array $args = [])
* @method \Aws\Result listProtectedResourcesByBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProtectedResourcesByBackupVaultAsync(array $args = [])
* @method \Aws\Result listRecoveryPointsByBackupVault(array $args = []) * @method \Aws\Result listRecoveryPointsByBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRecoveryPointsByBackupVaultAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listRecoveryPointsByBackupVaultAsync(array $args = [])
* @method \Aws\Result listRecoveryPointsByLegalHold(array $args = []) * @method \Aws\Result listRecoveryPointsByLegalHold(array $args = [])
@ -113,8 +137,16 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listReportJobsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listReportJobsAsync(array $args = [])
* @method \Aws\Result listReportPlans(array $args = []) * @method \Aws\Result listReportPlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise listReportPlansAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listReportPlansAsync(array $args = [])
* @method \Aws\Result listRestoreJobSummaries(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreJobSummariesAsync(array $args = [])
* @method \Aws\Result listRestoreJobs(array $args = []) * @method \Aws\Result listRestoreJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreJobsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listRestoreJobsAsync(array $args = [])
* @method \Aws\Result listRestoreJobsByProtectedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreJobsByProtectedResourceAsync(array $args = [])
* @method \Aws\Result listRestoreTestingPlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreTestingPlansAsync(array $args = [])
* @method \Aws\Result listRestoreTestingSelections(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreTestingSelectionsAsync(array $args = [])
* @method \Aws\Result listTags(array $args = []) * @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result putBackupVaultAccessPolicy(array $args = []) * @method \Aws\Result putBackupVaultAccessPolicy(array $args = [])
@ -123,6 +155,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise putBackupVaultLockConfigurationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putBackupVaultLockConfigurationAsync(array $args = [])
* @method \Aws\Result putBackupVaultNotifications(array $args = []) * @method \Aws\Result putBackupVaultNotifications(array $args = [])
* @method \GuzzleHttp\Promise\Promise putBackupVaultNotificationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putBackupVaultNotificationsAsync(array $args = [])
* @method \Aws\Result putRestoreValidationResult(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRestoreValidationResultAsync(array $args = [])
* @method \Aws\Result startBackupJob(array $args = []) * @method \Aws\Result startBackupJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startBackupJobAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise startBackupJobAsync(array $args = [])
* @method \Aws\Result startCopyJob(array $args = []) * @method \Aws\Result startCopyJob(array $args = [])
@ -149,5 +183,9 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateRegionSettingsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateRegionSettingsAsync(array $args = [])
* @method \Aws\Result updateReportPlan(array $args = []) * @method \Aws\Result updateReportPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateReportPlanAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateReportPlanAsync(array $args = [])
* @method \Aws\Result updateRestoreTestingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRestoreTestingPlanAsync(array $args = [])
* @method \Aws\Result updateRestoreTestingSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRestoreTestingSelectionAsync(array $args = [])
*/ */
class BackupClient extends AwsClient {} class BackupClient extends AwsClient {}

View file

@ -0,0 +1,49 @@
<?php
namespace Aws\Bedrock;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Bedrock** service.
* @method \Aws\Result createModelCustomizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise createModelCustomizationJobAsync(array $args = [])
* @method \Aws\Result createProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise createProvisionedModelThroughputAsync(array $args = [])
* @method \Aws\Result deleteCustomModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCustomModelAsync(array $args = [])
* @method \Aws\Result deleteModelInvocationLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteModelInvocationLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result deleteProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProvisionedModelThroughputAsync(array $args = [])
* @method \Aws\Result getCustomModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCustomModelAsync(array $args = [])
* @method \Aws\Result getFoundationModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFoundationModelAsync(array $args = [])
* @method \Aws\Result getModelCustomizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelCustomizationJobAsync(array $args = [])
* @method \Aws\Result getModelInvocationLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelInvocationLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result getProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProvisionedModelThroughputAsync(array $args = [])
* @method \Aws\Result listCustomModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCustomModelsAsync(array $args = [])
* @method \Aws\Result listFoundationModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFoundationModelsAsync(array $args = [])
* @method \Aws\Result listModelCustomizationJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listModelCustomizationJobsAsync(array $args = [])
* @method \Aws\Result listProvisionedModelThroughputs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProvisionedModelThroughputsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putModelInvocationLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putModelInvocationLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result stopModelCustomizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopModelCustomizationJobAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateProvisionedModelThroughput(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateProvisionedModelThroughputAsync(array $args = [])
*/
class BedrockClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\Bedrock\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Amazon Bedrock** service.
*/
class BedrockException extends AwsException {}

View file

@ -0,0 +1,89 @@
<?php
namespace Aws\BedrockAgent;
use Aws\AwsClient;
/**
* This client is used to interact with the **Agents for Amazon Bedrock** service.
* @method \Aws\Result associateAgentKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateAgentKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result createAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAgentAsync(array $args = [])
* @method \Aws\Result createAgentActionGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAgentActionGroupAsync(array $args = [])
* @method \Aws\Result createAgentAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAgentAliasAsync(array $args = [])
* @method \Aws\Result createDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataSourceAsync(array $args = [])
* @method \Aws\Result createKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise createKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result deleteAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAgentAsync(array $args = [])
* @method \Aws\Result deleteAgentActionGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAgentActionGroupAsync(array $args = [])
* @method \Aws\Result deleteAgentAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAgentAliasAsync(array $args = [])
* @method \Aws\Result deleteAgentVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAgentVersionAsync(array $args = [])
* @method \Aws\Result deleteDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataSourceAsync(array $args = [])
* @method \Aws\Result deleteKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result disassociateAgentKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateAgentKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result getAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAgentAsync(array $args = [])
* @method \Aws\Result getAgentActionGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAgentActionGroupAsync(array $args = [])
* @method \Aws\Result getAgentAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAgentAliasAsync(array $args = [])
* @method \Aws\Result getAgentKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAgentKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result getAgentVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAgentVersionAsync(array $args = [])
* @method \Aws\Result getDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceAsync(array $args = [])
* @method \Aws\Result getIngestionJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIngestionJobAsync(array $args = [])
* @method \Aws\Result getKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise getKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result listAgentActionGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAgentActionGroupsAsync(array $args = [])
* @method \Aws\Result listAgentAliases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAgentAliasesAsync(array $args = [])
* @method \Aws\Result listAgentKnowledgeBases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAgentKnowledgeBasesAsync(array $args = [])
* @method \Aws\Result listAgentVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAgentVersionsAsync(array $args = [])
* @method \Aws\Result listAgents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAgentsAsync(array $args = [])
* @method \Aws\Result listDataSources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataSourcesAsync(array $args = [])
* @method \Aws\Result listIngestionJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listIngestionJobsAsync(array $args = [])
* @method \Aws\Result listKnowledgeBases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listKnowledgeBasesAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result prepareAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise prepareAgentAsync(array $args = [])
* @method \Aws\Result startIngestionJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startIngestionJobAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAgentAsync(array $args = [])
* @method \Aws\Result updateAgentActionGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAgentActionGroupAsync(array $args = [])
* @method \Aws\Result updateAgentAlias(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAgentAliasAsync(array $args = [])
* @method \Aws\Result updateAgentKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAgentKnowledgeBaseAsync(array $args = [])
* @method \Aws\Result updateDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataSourceAsync(array $args = [])
* @method \Aws\Result updateKnowledgeBase(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateKnowledgeBaseAsync(array $args = [])
*/
class BedrockAgentClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\BedrockAgent\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Agents for Amazon Bedrock** service.
*/
class BedrockAgentException extends AwsException {}

View file

@ -0,0 +1,15 @@
<?php
namespace Aws\BedrockAgentRuntime;
use Aws\AwsClient;
/**
* This client is used to interact with the **Agents for Amazon Bedrock Runtime** service.
* @method \Aws\Result invokeAgent(array $args = [])
* @method \GuzzleHttp\Promise\Promise invokeAgentAsync(array $args = [])
* @method \Aws\Result retrieve(array $args = [])
* @method \GuzzleHttp\Promise\Promise retrieveAsync(array $args = [])
* @method \Aws\Result retrieveAndGenerate(array $args = [])
* @method \GuzzleHttp\Promise\Promise retrieveAndGenerateAsync(array $args = [])
*/
class BedrockAgentRuntimeClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\BedrockAgentRuntime\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Agents for Amazon Bedrock Runtime** service.
*/
class BedrockAgentRuntimeException extends AwsException {}

View file

@ -0,0 +1,13 @@
<?php
namespace Aws\BedrockRuntime;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Bedrock Runtime** service.
* @method \Aws\Result invokeModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise invokeModelAsync(array $args = [])
* @method \Aws\Result invokeModelWithResponseStream(array $args = [])
* @method \GuzzleHttp\Promise\Promise invokeModelWithResponseStreamAsync(array $args = [])
*/
class BedrockRuntimeClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\BedrockRuntime\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Amazon Bedrock Runtime** service.
*/
class BedrockRuntimeException extends AwsException {}

View file

@ -33,6 +33,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise disassociateAccountsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise disassociateAccountsAsync(array $args = [])
* @method \Aws\Result disassociatePricingRules(array $args = []) * @method \Aws\Result disassociatePricingRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociatePricingRulesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise disassociatePricingRulesAsync(array $args = [])
* @method \Aws\Result getBillingGroupCostReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBillingGroupCostReportAsync(array $args = [])
* @method \Aws\Result listAccountAssociations(array $args = []) * @method \Aws\Result listAccountAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccountAssociationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listAccountAssociationsAsync(array $args = [])
* @method \Aws\Result listBillingGroupCostReports(array $args = []) * @method \Aws\Result listBillingGroupCostReports(array $args = [])

Some files were not shown because too many files have changed in this diff Show more