mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 01:57:13 +00:00
Updated CRT library, test process, EventLoopGroup API updates (#16)
* Updated to latest aws-crt-ffi, updated EventLoopGroup/options init * Removed test-ci target, just use test for everything now * Added event_loop_group API to CRT/stubs * Removed headers (all generated) from format-check * Added the ability to force extension vs FFI * make test will now trigger composer run test/phpunit, and force tests with both FFI and extension * Updated builder version, removed redundant php7 test run * Removed type annotations that anger php5, limited backends on php5
This commit is contained in:
@@ -7,7 +7,7 @@ on:
|
|||||||
- '!main'
|
- '!main'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILDER_VERSION: v0.8.1
|
BUILDER_VERSION: v0.8.9
|
||||||
BUILDER_SOURCE: releases
|
BUILDER_SOURCE: releases
|
||||||
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
|
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
|
||||||
PACKAGE_NAME: aws-crt-php
|
PACKAGE_NAME: aws-crt-php
|
||||||
@@ -15,27 +15,17 @@ env:
|
|||||||
RUN: ${{ github.run_id }}-${{ github.run_number }}
|
RUN: ${{ github.run_id }}-${{ github.run_number }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
php7-linux-x64-ffi:
|
php7-linux-x64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build PHP 7.4 with ffi
|
- name: Build PHP 7.4 with ffi
|
||||||
run: |
|
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
|
|
||||||
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-php7-linux-x64:${{ env.BUILDER_VERSION }}
|
|
||||||
docker pull $DOCKER_IMAGE
|
|
||||||
docker run --env GITHUB_REF --env LC_ALL=C.UTF-8 --env TEST_FFI=1 $DOCKER_IMAGE --version=${{env.BUILDER_VERSION}} build -p ${{ env.PACKAGE_NAME }} --spec=downstream --skip-install
|
|
||||||
|
|
||||||
php7-linux-x64-ext:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Build PHP 7.4 extension
|
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
|
||||||
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-php7-linux-x64:${{ env.BUILDER_VERSION }}
|
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-php7-linux-x64:${{ env.BUILDER_VERSION }}
|
||||||
docker pull $DOCKER_IMAGE
|
docker pull $DOCKER_IMAGE
|
||||||
docker run --env GITHUB_REF --env LC_ALL=C.UTF-8 $DOCKER_IMAGE --version=${{env.BUILDER_VERSION}} build -p ${{ env.PACKAGE_NAME }} --spec=downstream --skip-install
|
docker run --env GITHUB_REF --env LC_ALL=C.UTF-8 $DOCKER_IMAGE --version=${{env.BUILDER_VERSION}} build -p ${{ env.PACKAGE_NAME }} --spec=downstream --skip-install
|
||||||
|
|
||||||
php5-linux-x64-ext:
|
php5-linux-x64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build PHP 5.6 extension
|
- name: Build PHP 5.6 extension
|
||||||
|
|||||||
+10
-10
@@ -58,19 +58,19 @@ ext/api.h : src/api.h
|
|||||||
|
|
||||||
# FFI target
|
# FFI target
|
||||||
ffi: src/libaws-crt-ffi.so
|
ffi: src/libaws-crt-ffi.so
|
||||||
TEST_FFI = 1
|
|
||||||
|
|
||||||
# copy the lib into the src folder
|
# copy the lib into the src folder
|
||||||
src/libaws-crt-ffi.so: $(BUILD_DIR)/aws-crt-ffi-shared/libaws-crt-ffi.so $(INSTALL_DIR)/src/api.h
|
src/libaws-crt-ffi.so: $(BUILD_DIR)/aws-crt-ffi-shared/libaws-crt-ffi.so src/api.h
|
||||||
cp -v $(BUILD_DIR)/aws-crt-ffi-shared/libaws-crt-ffi.so $(INSTALL_DIR)/src/libaws-crt-ffi.so
|
cp -v $(BUILD_DIR)/aws-crt-ffi-shared/libaws-crt-ffi.so src/libaws-crt-ffi.so
|
||||||
|
|
||||||
ifeq ($(TEST_FFI),1)
|
# Test the FFI interface on PHP7+
|
||||||
test-ci: test-ffi
|
ifeq ($(AT_LEAST_PHP7), 1)
|
||||||
|
test: src/libaws-crt-ffi.so
|
||||||
|
composer update
|
||||||
|
AWS_CRT_PHP_EXTENSION=1 composer run test
|
||||||
|
AWS_CRT_PHP_FFI=1 composer run test
|
||||||
else
|
else
|
||||||
test-ci: test
|
test: ext/api.h ext/awscrt_arginfo.h ext/crt.lo
|
||||||
endif
|
|
||||||
|
|
||||||
# Test the FFI interface
|
|
||||||
test-ffi: src/libaws-crt-ffi.so
|
|
||||||
composer update
|
composer update
|
||||||
composer run test
|
composer run test
|
||||||
|
endif
|
||||||
|
|||||||
+1
-1
@@ -32,6 +32,6 @@
|
|||||||
"NO_INTERACTION": "1"
|
"NO_INTERACTION": "1"
|
||||||
},
|
},
|
||||||
"test_steps": [
|
"test_steps": [
|
||||||
["make", "test-ci"]
|
["make", "test"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-9
@@ -10,6 +10,9 @@
|
|||||||
"email": "[email protected]"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"config": {
|
||||||
|
"platform": {"php": "5.6"}
|
||||||
|
},
|
||||||
"minimum-stability": "alpha",
|
"minimum-stability": "alpha",
|
||||||
"require": {
|
"require": {
|
||||||
},
|
},
|
||||||
@@ -30,14 +33,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "phpunit src/tests"
|
"test": "@php -d extension=modules/awscrt.so vendor/bin/phpunit src/tests"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0"
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "AWS Common Runtime Team",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+99
-116
@@ -4,36 +4,39 @@
|
|||||||
"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": "701910d2701734e6469f8b2ce89efcd1",
|
"content-hash": "d1e4715f1331f5ef3a9a1966360c6cd6",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "doctrine/instantiator",
|
"name": "doctrine/instantiator",
|
||||||
"version": "1.4.0",
|
"version": "1.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/doctrine/instantiator.git",
|
"url": "https://github.com/doctrine/instantiator.git",
|
||||||
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
|
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
|
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||||
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
|
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": ">=5.3,<8.0-DEV"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/coding-standard": "^8.0",
|
"athletic/athletic": "~0.1.8",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"ext-phar": "*",
|
"ext-phar": "*",
|
||||||
"phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
|
"phpunit/phpunit": "~4.0",
|
||||||
"phpstan/phpstan": "^0.12",
|
"squizlabs/php_codesniffer": "~2.0"
|
||||||
"phpstan/phpstan-phpunit": "^0.12",
|
|
||||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
|
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
||||||
@@ -47,59 +50,42 @@
|
|||||||
{
|
{
|
||||||
"name": "Marco Pivetta",
|
"name": "Marco Pivetta",
|
||||||
"email": "[email protected]",
|
"email": "[email protected]",
|
||||||
"homepage": "https://ocramius.github.io/"
|
"homepage": "http://ocramius.github.com/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
||||||
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
|
"homepage": "https://github.com/doctrine/instantiator",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"constructor",
|
"constructor",
|
||||||
"instantiate"
|
"instantiate"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/doctrine/instantiator/issues",
|
"issues": "https://github.com/doctrine/instantiator/issues",
|
||||||
"source": "https://github.com/doctrine/instantiator/tree/1.4.0"
|
"source": "https://github.com/doctrine/instantiator/tree/master"
|
||||||
},
|
},
|
||||||
"funding": [
|
"time": "2015-06-14T21:17:01+00:00"
|
||||||
{
|
|
||||||
"url": "https://www.doctrine-project.org/sponsorship.html",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://www.patreon.com/phpdoctrine",
|
|
||||||
"type": "patreon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2020-11-10T18:47:58+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "myclabs/deep-copy",
|
"name": "myclabs/deep-copy",
|
||||||
"version": "1.10.2",
|
"version": "1.7.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||||
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
|
"reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
|
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
|
||||||
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
|
"reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": "^5.6 || ^7.0"
|
||||||
},
|
|
||||||
"replace": {
|
|
||||||
"myclabs/deep-copy": "self.version"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/collections": "^1.0",
|
"doctrine/collections": "^1.0",
|
||||||
"doctrine/common": "^2.6",
|
"doctrine/common": "^2.6",
|
||||||
"phpunit/phpunit": "^7.1"
|
"phpunit/phpunit": "^4.1"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -124,42 +110,41 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
||||||
"source": "https://github.com/myclabs/DeepCopy/tree/1.10.2"
|
"source": "https://github.com/myclabs/DeepCopy/tree/1.x"
|
||||||
},
|
},
|
||||||
"funding": [
|
"time": "2017-10-19T19:58:43+00:00"
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2020-11-13T09:40:50+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-common",
|
"name": "phpdocumentor/reflection-common",
|
||||||
"version": "2.2.0",
|
"version": "1.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
||||||
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
|
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
|
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||||
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
|
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2 || ^8.0"
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.6"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-2.x": "2.x-dev"
|
"dev-master": "1.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"phpDocumentor\\Reflection\\": "src/"
|
"phpDocumentor\\Reflection\\": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -183,43 +168,40 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
|
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
|
||||||
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
|
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master"
|
||||||
},
|
},
|
||||||
"time": "2020-06-27T09:03:43+00:00"
|
"time": "2017-09-11T18:02:19+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-docblock",
|
"name": "phpdocumentor/reflection-docblock",
|
||||||
"version": "5.2.2",
|
"version": "3.3.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
|
"reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
|
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
|
||||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
|
"reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-filter": "*",
|
"php": "^5.6 || ^7.0",
|
||||||
"php": "^7.2 || ^8.0",
|
"phpdocumentor/reflection-common": "^1.0.0",
|
||||||
"phpdocumentor/reflection-common": "^2.2",
|
"phpdocumentor/type-resolver": "^0.4.0",
|
||||||
"phpdocumentor/type-resolver": "^1.3",
|
"webmozart/assert": "^1.0"
|
||||||
"webmozart/assert": "^1.9.1"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mockery/mockery": "~1.3.2"
|
"mockery/mockery": "^0.9.4",
|
||||||
|
"phpunit/phpunit": "^4.4"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "5.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"phpDocumentor\\Reflection\\": "src"
|
"phpDocumentor\\Reflection\\": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -230,49 +212,48 @@
|
|||||||
{
|
{
|
||||||
"name": "Mike van Riel",
|
"name": "Mike van Riel",
|
||||||
"email": "[email protected]"
|
"email": "[email protected]"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jaap van Otterdijk",
|
|
||||||
"email": "[email protected]"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
|
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/3.x"
|
||||||
},
|
},
|
||||||
"time": "2020-09-03T19:13:55+00:00"
|
"time": "2017-11-10T14:09:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/type-resolver",
|
"name": "phpdocumentor/type-resolver",
|
||||||
"version": "1.4.0",
|
"version": "0.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
||||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
|
"reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
|
||||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
"reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2 || ^8.0",
|
"php": "^5.5 || ^7.0",
|
||||||
"phpdocumentor/reflection-common": "^2.0"
|
"phpdocumentor/reflection-common": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-tokenizer": "*"
|
"mockery/mockery": "^0.9.4",
|
||||||
|
"phpunit/phpunit": "^5.2||^4.8.24"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-1.x": "1.x-dev"
|
"dev-master": "1.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"phpDocumentor\\Reflection\\": "src"
|
"phpDocumentor\\Reflection\\": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -285,12 +266,11 @@
|
|||||||
"email": "[email protected]"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
||||||
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
|
"source": "https://github.com/phpDocumentor/TypeResolver/tree/master"
|
||||||
},
|
},
|
||||||
"time": "2020-09-17T18:55:26+00:00"
|
"time": "2017-07-14T14:27:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpspec/prophecy",
|
"name": "phpspec/prophecy",
|
||||||
@@ -579,29 +559,29 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-token-stream",
|
"name": "phpunit/php-token-stream",
|
||||||
"version": "2.0.2",
|
"version": "1.4.12",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
||||||
"reference": "791198a2c6254db10131eecfe8c06670700904db"
|
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
|
||||||
"reference": "791198a2c6254db10131eecfe8c06670700904db",
|
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"php": "^7.0"
|
"php": ">=5.3.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^6.2.4"
|
"phpunit/phpunit": "~4.2"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.0-dev"
|
"dev-master": "1.4-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -626,10 +606,10 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
|
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
|
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4"
|
||||||
},
|
},
|
||||||
"abandoned": true,
|
"abandoned": true,
|
||||||
"time": "2017-11-27T05:48:46+00:00"
|
"time": "2017-12-04T08:55:13+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
@@ -1343,20 +1323,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
"version": "v1.22.1",
|
"version": "v1.19.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
|
"reference": "aed596913b70fae57be53d86faa2e9ef85a2297b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
|
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b",
|
||||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
|
"reference": "aed596913b70fae57be53d86faa2e9ef85a2297b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1"
|
"php": ">=5.3.3"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-ctype": "For best performance"
|
"ext-ctype": "For best performance"
|
||||||
@@ -1364,7 +1344,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.22-dev"
|
"dev-main": "1.19-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
@@ -1402,7 +1382,7 @@
|
|||||||
"portable"
|
"portable"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1418,31 +1398,31 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-01-07T16:49:33+00:00"
|
"time": "2020-10-23T09:01:57+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/yaml",
|
"name": "symfony/yaml",
|
||||||
"version": "v4.4.19",
|
"version": "v3.4.47",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/yaml.git",
|
"url": "https://github.com/symfony/yaml.git",
|
||||||
"reference": "17ed9f14c1aa05b1a5cf2e2c5ef2d0be28058ef9"
|
"reference": "88289caa3c166321883f67fe5130188ebbb47094"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/17ed9f14c1aa05b1a5cf2e2c5ef2d0be28058ef9",
|
"url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094",
|
||||||
"reference": "17ed9f14c1aa05b1a5cf2e2c5ef2d0be28058ef9",
|
"reference": "88289caa3c166321883f67fe5130188ebbb47094",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.3",
|
"php": "^5.5.9|>=7.0.8",
|
||||||
"symfony/polyfill-ctype": "~1.8"
|
"symfony/polyfill-ctype": "~1.8"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/console": "<3.4"
|
"symfony/console": "<3.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/console": "^3.4|^4.0|^5.0"
|
"symfony/console": "~3.4|~4.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"symfony/console": "For validating YAML files using the lint command"
|
"symfony/console": "For validating YAML files using the lint command"
|
||||||
@@ -1470,10 +1450,10 @@
|
|||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Loads and dumps YAML files",
|
"description": "Symfony Yaml Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/yaml/tree/v4.4.19"
|
"source": "https://github.com/symfony/yaml/tree/v3.4.47"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1489,7 +1469,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-01-27T09:09:26+00:00"
|
"time": "2020-10-24T10:57:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "webmozart/assert",
|
"name": "webmozart/assert",
|
||||||
@@ -1546,11 +1526,14 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "alpha",
|
||||||
"stability-flags": [],
|
"stability-flags": [],
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": [],
|
"platform": [],
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
|
"platform-overrides": {
|
||||||
|
"php": "5.6"
|
||||||
|
},
|
||||||
"plugin-api-version": "2.0.0"
|
"plugin-api-version": "2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
Submodule crt/aws-crt-ffi updated: ea85a85a82...93a2f64b7e
+8
-2
@@ -10,6 +10,12 @@ function aws_crt_error_str(int $error_code): string {}
|
|||||||
|
|
||||||
function aws_crt_error_debug_str(int $error_code): string {}
|
function aws_crt_error_debug_str(int $error_code): string {}
|
||||||
|
|
||||||
function aws_crt_event_loop_group_new(int $max_threads): int {}
|
function aws_crt_event_loop_group_options_new(): object {}
|
||||||
|
|
||||||
function aws_crt_event_loop_group_release(int $event_loop_group): void {}
|
function aws_crt_event_loop_group_options_release(object $elg_options): void {}
|
||||||
|
|
||||||
|
function aws_crt_event_loop_group_options_set_max_threads(object $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 {}
|
||||||
|
|||||||
+21
-3
@@ -1,5 +1,5 @@
|
|||||||
/* This is a generated file, edit the .stub.php file instead.
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
* Stub hash: 04ff04fec5e4293918658ac98394d98387fa977b */
|
* Stub hash: a2ad6edf64d0416356ba2a9a4c8b184615054a7c */
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_last_error, 0, 0, IS_LONG, 0)
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_last_error, 0, 0, IS_LONG, 0)
|
||||||
ZEND_END_ARG_INFO()
|
ZEND_END_ARG_INFO()
|
||||||
@@ -12,12 +12,24 @@ ZEND_END_ARG_INFO()
|
|||||||
|
|
||||||
#define arginfo_aws_crt_error_debug_str arginfo_aws_crt_error_name
|
#define arginfo_aws_crt_error_debug_str arginfo_aws_crt_error_name
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_new, 0, 1, IS_LONG, 0)
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_options_new, 0, 0, IS_OBJECT, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_options_release, 0, 1, IS_VOID, 0)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, elg_options, IS_OBJECT, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_options_set_max_threads, 0, 2, IS_VOID, 0)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, elg_options, IS_OBJECT, 0)
|
||||||
ZEND_ARG_TYPE_INFO(0, max_threads, IS_LONG, 0)
|
ZEND_ARG_TYPE_INFO(0, max_threads, IS_LONG, 0)
|
||||||
ZEND_END_ARG_INFO()
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_new, 0, 1, IS_OBJECT, 0)
|
||||||
|
ZEND_ARG_TYPE_INFO(0, options, IS_OBJECT, 0)
|
||||||
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_release, 0, 1, IS_VOID, 0)
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_aws_crt_event_loop_group_release, 0, 1, IS_VOID, 0)
|
||||||
ZEND_ARG_TYPE_INFO(0, event_loop_group, IS_LONG, 0)
|
ZEND_ARG_TYPE_INFO(0, event_loop_group, IS_OBJECT, 0)
|
||||||
ZEND_END_ARG_INFO()
|
ZEND_END_ARG_INFO()
|
||||||
|
|
||||||
|
|
||||||
@@ -25,6 +37,9 @@ ZEND_FUNCTION(aws_crt_last_error);
|
|||||||
ZEND_FUNCTION(aws_crt_error_name);
|
ZEND_FUNCTION(aws_crt_error_name);
|
||||||
ZEND_FUNCTION(aws_crt_error_str);
|
ZEND_FUNCTION(aws_crt_error_str);
|
||||||
ZEND_FUNCTION(aws_crt_error_debug_str);
|
ZEND_FUNCTION(aws_crt_error_debug_str);
|
||||||
|
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_new);
|
||||||
ZEND_FUNCTION(aws_crt_event_loop_group_release);
|
ZEND_FUNCTION(aws_crt_event_loop_group_release);
|
||||||
|
|
||||||
@@ -34,6 +49,9 @@ static const zend_function_entry ext_functions[] = {
|
|||||||
ZEND_FE(aws_crt_error_name, arginfo_aws_crt_error_name)
|
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_str, arginfo_aws_crt_error_str)
|
||||||
ZEND_FE(aws_crt_error_debug_str, arginfo_aws_crt_error_debug_str)
|
ZEND_FE(aws_crt_error_debug_str, arginfo_aws_crt_error_debug_str)
|
||||||
|
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_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_event_loop_group_release, arginfo_aws_crt_event_loop_group_release)
|
||||||
ZEND_FE_END
|
ZEND_FE_END
|
||||||
|
|||||||
@@ -81,14 +81,43 @@ PHP_FUNCTION(aws_crt_error_debug_str) {
|
|||||||
AWS_RETURN_STRING(aws_crt_error_debug_str(error_code));
|
AWS_RETURN_STRING(aws_crt_error_debug_str(error_code));
|
||||||
}
|
}
|
||||||
|
|
||||||
PHP_FUNCTION(aws_crt_event_loop_group_new) {
|
PHP_FUNCTION(aws_crt_event_loop_group_options_new) {
|
||||||
|
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;
|
||||||
|
|
||||||
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &php_options) == FAILURE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
zend_ulong num_threads = 0;
|
||||||
|
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num_threads) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &php_options, &num_threads) == FAILURE) {
|
||||||
RETURN_NULL();
|
RETURN_NULL();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct aws_event_loop_group *elg = aws_crt_event_loop_group_new(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;
|
||||||
|
|
||||||
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &php_options) == FAILURE) {
|
||||||
|
RETURN_NULL();
|
||||||
|
}
|
||||||
|
|
||||||
|
aws_crt_event_loop_group_options *options = (void *)php_options;
|
||||||
|
struct aws_event_loop_group *elg = aws_crt_event_loop_group_new(options);
|
||||||
RETURN_LONG((zend_ulong)elg);
|
RETURN_LONG((zend_ulong)elg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ if NOT type $CLANG_FORMAT 2> /dev/null ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
FAIL=0
|
FAIL=0
|
||||||
SOURCE_FILES=`find src ext -type f \( -name '*.h' -o -name '*.c' \)`
|
SOURCE_FILES=`find src ext -type f \( -name '*.c' \)`
|
||||||
for i in $SOURCE_FILES
|
for i in $SOURCE_FILES
|
||||||
do
|
do
|
||||||
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
|
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
|
||||||
|
|||||||
+50
-13
@@ -20,15 +20,30 @@ final class CRT {
|
|||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
if (is_null(self::$impl)) {
|
if (is_null(self::$impl)) {
|
||||||
try {
|
// Figure out what backends are/should be available
|
||||||
self::$impl = new Extension();
|
$backends = ['Extension'];
|
||||||
} catch (RuntimeException $rex) {
|
if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
|
||||||
try {
|
$backends = ['Extension', 'FFI'];
|
||||||
self::$impl = new FFI();
|
if (getenv('AWS_CRT_PHP_EXTENSION')) {
|
||||||
} catch (RuntimeException $frex) {
|
$backends = ['Extension'];
|
||||||
throw new RuntimeException('Unable to initialize AWS CRT via extension or FFI', -1, $frex);
|
} else if (getenv('AWS_CRT_PHP_FFI')) {
|
||||||
|
$backends = ['FFI'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try to load each backend, give up if none succeed
|
||||||
|
$exceptions = [];
|
||||||
|
foreach ($backends as $backend) {
|
||||||
|
try {
|
||||||
|
$backend = 'AWS\\CRT\\Internal\\' . $backend;
|
||||||
|
self::$impl = new $backend();
|
||||||
|
} catch (RuntimeException $rex) {
|
||||||
|
array_push($exceptions, $rex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (is_null(self::$impl)) {
|
||||||
|
throw new RuntimeException('Unable to initialize AWS CRT via ' . join(', ', $backends) . ": \n" . join("\n", $exceptions), -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
++self::$refcount;
|
++self::$refcount;
|
||||||
}
|
}
|
||||||
@@ -42,7 +57,7 @@ final class CRT {
|
|||||||
/**
|
/**
|
||||||
* @return integer last error code reported within the CRT
|
* @return integer last error code reported within the CRT
|
||||||
*/
|
*/
|
||||||
public static function last_error(): int {
|
public static function last_error() {
|
||||||
return self::$impl->aws_crt_last_error();
|
return self::$impl->aws_crt_last_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +65,7 @@ final class CRT {
|
|||||||
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
||||||
* @return string Human-readable description of the provided error code
|
* @return string Human-readable description of the provided error code
|
||||||
*/
|
*/
|
||||||
public static function error_str(int $error) : string {
|
public static function error_str($error) {
|
||||||
return self::$impl->aws_crt_error_str((int) $error);
|
return self::$impl->aws_crt_error_str((int) $error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,16 +73,38 @@ final class CRT {
|
|||||||
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
||||||
* @return string Name/enum identifier for the provided error code
|
* @return string Name/enum identifier for the provided error code
|
||||||
*/
|
*/
|
||||||
public static function error_name(int $error) : string {
|
public static function error_name($error) {
|
||||||
return self::$impl->aws_crt_error_name((int) $error);
|
return self::$impl->aws_crt_error_name((int) $error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer $num_threads Maximum threads to use in the event loop group
|
* @return object Pointer to native event_loop_group_options
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_new() {
|
||||||
|
return self::$impl->aws_crt_event_loop_group_options_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object $elg_options Pointer to native event_loop_group_options
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_release($elg_options) {
|
||||||
|
self::$impl->aws_crt_event_loop_group_options_release($elg_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object $elg_options Pointer to native event_loop_group_options
|
||||||
|
* @param integer $max_threads Maximum number of threads to allow the event loop group to use, default: 0/1 per CPU core
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_set_max_threads($elg_options, $max_threads) {
|
||||||
|
self::$impl->aws_crt_event_loop_group_options_set_max_threads($elg_options, (int)$max_threads);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object Pointer to event_loop_group_options, {@see event_loop_group_options_new}
|
||||||
* @return object Pointer to the new event loop group
|
* @return object Pointer to the new event loop group
|
||||||
*/
|
*/
|
||||||
function event_loop_group_new(int $num_threads) {
|
function event_loop_group_new($options) {
|
||||||
return self::$impl->aws_crt_event_loop_group_new($num_threads);
|
return self::$impl->aws_crt_event_loop_group_new($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ final class EventLoopGroup extends NativeResource {
|
|||||||
|
|
||||||
static function defaults() {
|
static function defaults() {
|
||||||
return array(
|
return array(
|
||||||
'num_threads' => 0,
|
'max_threads' => 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,10 @@ final class EventLoopGroup extends NativeResource {
|
|||||||
if (count($options) == 0) {
|
if (count($options) == 0) {
|
||||||
$options = self::defaults();
|
$options = self::defaults();
|
||||||
}
|
}
|
||||||
$this->acquire(self::$crt->event_loop_group_new($options['num_threads']));
|
$elg_options = self::$crt->event_loop_group_options_new();
|
||||||
|
self::$crt->event_loop_group_options_set_max_threads($elg_options, $options['max_threads']);
|
||||||
|
$this->acquire(self::$crt->event_loop_group_new($elg_options));
|
||||||
|
self::$crt->event_loop_group_options_release($elg_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function __destruct() {
|
function __destruct() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ final class Extension {
|
|||||||
* same name with the supplied arguments. Argument type hinting and checking
|
* same name with the supplied arguments. Argument type hinting and checking
|
||||||
* occurs at the CRT wrapper.
|
* occurs at the CRT wrapper.
|
||||||
*/
|
*/
|
||||||
function __call(string $name, $args) {
|
function __call($name, $args) {
|
||||||
return call_user_func_array($name, $args);
|
return call_user_func_array($name, $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user