mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6238 Security hardening
This commit is contained in:
@@ -12,10 +12,10 @@
|
|||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mysqli": "*",
|
"ext-mysqli": "*",
|
||||||
"ext-soap": "*",
|
"ext-soap": "*",
|
||||||
"apereo/phpcas" : "~1.6.0",
|
"apereo/phpcas": "~1.6.0",
|
||||||
"combodo/tcpdf": "~6.4.4",
|
"combodo/tcpdf": "~6.4.4",
|
||||||
"firebase/php-jwt": "~6.4.0",
|
"firebase/php-jwt": "~6.4.0",
|
||||||
"guzzlehttp/guzzle": "^7.4.5",
|
"guzzlehttp/guzzle": "^7.5.1",
|
||||||
"laminas/laminas-mail": "^2.11",
|
"laminas/laminas-mail": "^2.11",
|
||||||
"laminas/laminas-servicemanager": "^3.5",
|
"laminas/laminas-servicemanager": "^3.5",
|
||||||
"league/oauth2-google": "^3.0",
|
"league/oauth2-google": "^3.0",
|
||||||
|
|||||||
130
composer.lock
generated
130
composer.lock
generated
@@ -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": "69db9dbdea61a588fa2058724d91a579",
|
"content-hash": "cb3883f141f50e1bfbc957880ab93be1",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "apereo/phpcas",
|
"name": "apereo/phpcas",
|
||||||
@@ -217,22 +217,22 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "7.4.5",
|
"version": "7.7.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/guzzle.git",
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
"reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
|
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
|
||||||
"reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
|
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"guzzlehttp/promises": "^1.5",
|
"guzzlehttp/promises": "^1.5.3 || ^2.0",
|
||||||
"guzzlehttp/psr7": "^1.9 || ^2.4",
|
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"psr/http-client": "^1.0",
|
"psr/http-client": "^1.0",
|
||||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||||
@@ -241,10 +241,11 @@
|
|||||||
"psr/http-client-implementation": "1.0"
|
"psr/http-client-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"php-http/client-integration-tests": "^3.0",
|
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
|
||||||
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
|
"php-http/message-factory": "^1.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
|
||||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@@ -254,8 +255,9 @@
|
|||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "7.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -321,7 +323,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
"source": "https://github.com/guzzle/guzzle/tree/7.4.5"
|
"source": "https://github.com/guzzle/guzzle/tree/7.7.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -337,38 +339,37 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-06-20T22:16:13+00:00"
|
"time": "2023-05-21T14:04:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/promises",
|
"name": "guzzlehttp/promises",
|
||||||
"version": "1.5.1",
|
"version": "2.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/promises.git",
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
|
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
|
||||||
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5"
|
"php": "^7.2.5 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "^4.4 || ^5.1"
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "1.5-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
|
||||||
"src/functions_include.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GuzzleHttp\\Promise\\": "src/"
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
}
|
}
|
||||||
@@ -405,7 +406,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/promises/issues",
|
"issues": "https://github.com/guzzle/promises/issues",
|
||||||
"source": "https://github.com/guzzle/promises/tree/1.5.1"
|
"source": "https://github.com/guzzle/promises/tree/2.0.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -421,26 +422,26 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-10-22T20:56:57+00:00"
|
"time": "2023-05-21T13:50:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "2.4.0",
|
"version": "2.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "13388f00956b1503577598873fffb5ae994b5737"
|
"reference": "b635f279edd83fc275f822a1188157ffea568ff6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
|
||||||
"reference": "13388f00956b1503577598873fffb5ae994b5737",
|
"reference": "b635f279edd83fc275f822a1188157ffea568ff6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"psr/http-factory": "^1.0",
|
"psr/http-factory": "^1.0",
|
||||||
"psr/http-message": "^1.0",
|
"psr/http-message": "^1.1 || ^2.0",
|
||||||
"ralouphie/getallheaders": "^3.0"
|
"ralouphie/getallheaders": "^3.0"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
@@ -448,17 +449,18 @@
|
|||||||
"psr/http-message-implementation": "1.0"
|
"psr/http-message-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"http-interop/http-factory-tests": "^0.9",
|
"http-interop/http-factory-tests": "^0.9",
|
||||||
"phpunit/phpunit": "^8.5.8 || ^9.3.10"
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "2.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -520,7 +522,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
"source": "https://github.com/guzzle/psr7/tree/2.4.0"
|
"source": "https://github.com/guzzle/psr7/tree/2.5.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -536,7 +538,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-06-20T21:43:11+00:00"
|
"time": "2023-04-17T16:11:26+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laminas/laminas-loader",
|
"name": "laminas/laminas-loader",
|
||||||
@@ -1668,21 +1670,21 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-client",
|
"name": "psr/http-client",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-client.git",
|
"url": "https://github.com/php-fig/http-client.git",
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.0 || ^8.0",
|
"php": "^7.0 || ^8.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@@ -1702,7 +1704,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP clients",
|
"description": "Common interface for HTTP clients",
|
||||||
@@ -1714,27 +1716,27 @@
|
|||||||
"psr-18"
|
"psr-18"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
|
||||||
},
|
},
|
||||||
"time": "2020-06-29T06:28:15+00:00"
|
"time": "2023-04-10T20:12:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-factory",
|
"name": "psr/http-factory",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-factory.git",
|
"url": "https://github.com/php-fig/http-factory.git",
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
|
"reference": "e616d01114759c4c489f93b099585439f795fe35"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
"reference": "e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": ">=7.0.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@@ -1754,7 +1756,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interfaces for PSR-7 HTTP message factories",
|
"description": "Common interfaces for PSR-7 HTTP message factories",
|
||||||
@@ -1769,31 +1771,31 @@
|
|||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-factory/tree/master"
|
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
|
||||||
},
|
},
|
||||||
"time": "2019-04-30T12:38:16+00:00"
|
"time": "2023-04-10T20:10:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-message",
|
||||||
"version": "1.0.1",
|
"version": "2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
"url": "https://github.com/php-fig/http-message.git",
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0"
|
"php": "^7.2 || ^8.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.0.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1808,7 +1810,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP messages",
|
"description": "Common interface for HTTP messages",
|
||||||
@@ -1822,9 +1824,9 @@
|
|||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-message/tree/master"
|
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||||
},
|
},
|
||||||
"time": "2016-08-06T14:39:51+00:00"
|
"time": "2023-04-04T09:54:51+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
@@ -5274,5 +5276,5 @@
|
|||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "7.4.0"
|
"php": "7.4.0"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "2.1.0"
|
"plugin-api-version": "2.3.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
// autoload.php @generated by Composer
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
|
if (PHP_VERSION_ID < 50600) {
|
||||||
|
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f::getLoader();
|
return ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f::getLoader();
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[] Array of classname => path
|
* @return string[] Array of classname => path
|
||||||
* @psalm-var array<string, string>
|
* @psalm-return array<string, string>
|
||||||
*/
|
*/
|
||||||
public function getClassMap()
|
public function getClassMap()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,12 +21,14 @@ use Composer\Semver\VersionParser;
|
|||||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||||
*
|
*
|
||||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class InstalledVersions
|
class InstalledVersions
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var mixed[]|null
|
* @var mixed[]|null
|
||||||
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||||
*/
|
*/
|
||||||
private static $installed;
|
private static $installed;
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@ class InstalledVersions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var array[]
|
||||||
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||||
*/
|
*/
|
||||||
private static $installedByVendor = array();
|
private static $installedByVendor = array();
|
||||||
|
|
||||||
@@ -241,7 +243,7 @@ class InstalledVersions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||||
*/
|
*/
|
||||||
public static function getRootPackage()
|
public static function getRootPackage()
|
||||||
{
|
{
|
||||||
@@ -255,7 +257,7 @@ class InstalledVersions
|
|||||||
*
|
*
|
||||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||||
*/
|
*/
|
||||||
public static function getRawData()
|
public static function getRawData()
|
||||||
{
|
{
|
||||||
@@ -278,7 +280,7 @@ class InstalledVersions
|
|||||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||||
*
|
*
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||||
*/
|
*/
|
||||||
public static function getAllRawData()
|
public static function getAllRawData()
|
||||||
{
|
{
|
||||||
@@ -301,7 +303,7 @@ class InstalledVersions
|
|||||||
* @param array[] $data A vendor/composer/installed.php data set
|
* @param array[] $data A vendor/composer/installed.php data set
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||||
*/
|
*/
|
||||||
public static function reload($data)
|
public static function reload($data)
|
||||||
{
|
{
|
||||||
@@ -311,7 +313,7 @@ class InstalledVersions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||||
*/
|
*/
|
||||||
private static function getInstalled()
|
private static function getInstalled()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_classmap.php @generated by Composer
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(dirname(__FILE__));
|
$vendorDir = dirname(__DIR__);
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@@ -449,7 +449,6 @@ return array(
|
|||||||
'Combodo\\iTop\\Service\\Events\\EventServiceLog' => $baseDir . '/sources/Service/Events/EventServiceLog.php',
|
'Combodo\\iTop\\Service\\Events\\EventServiceLog' => $baseDir . '/sources/Service/Events/EventServiceLog.php',
|
||||||
'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => $baseDir . '/sources/Service/Events/iEventServiceSetup.php',
|
'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => $baseDir . '/sources/Service/Events/iEventServiceSetup.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => $baseDir . '/sources/Service/Links/LinkSetDataTransformer.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => $baseDir . '/sources/Service/Links/LinkSetDataTransformer.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetHelper' => $baseDir . '/sources/Service/Links/LinkSetHelper.php',
|
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetModel' => $baseDir . '/sources/Service/Links/LinkSetModel.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetModel' => $baseDir . '/sources/Service/Links/LinkSetModel.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => $baseDir . '/sources/Service/Links/LinkSetRepository.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => $baseDir . '/sources/Service/Links/LinkSetRepository.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => $baseDir . '/sources/Service/Links/LinksBulkDataPostProcessor.php',
|
'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => $baseDir . '/sources/Service/Links/LinksBulkDataPostProcessor.php',
|
||||||
|
|||||||
@@ -2,24 +2,23 @@
|
|||||||
|
|
||||||
// autoload_files.php @generated by Composer
|
// autoload_files.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(dirname(__FILE__));
|
$vendorDir = dirname(__DIR__);
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
|
||||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||||
|
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
|
|
||||||
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
|
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
|
||||||
|
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
|
||||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
|
||||||
'c9d07b32a2e02bc0fc582d4f0c1b56cc' => $vendorDir . '/laminas/laminas-servicemanager/src/autoload.php',
|
|
||||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||||
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||||
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
|
|
||||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
|
|
||||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||||
|
'c9d07b32a2e02bc0fc582d4f0c1b56cc' => $vendorDir . '/laminas/laminas-servicemanager/src/autoload.php',
|
||||||
|
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||||
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||||
|
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_namespaces.php @generated by Composer
|
// autoload_namespaces.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(dirname(__FILE__));
|
$vendorDir = dirname(__DIR__);
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_psr4.php @generated by Composer
|
// autoload_psr4.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(dirname(__FILE__));
|
$vendorDir = dirname(__DIR__);
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
@@ -25,33 +25,20 @@ class ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f
|
|||||||
require __DIR__ . '/platform_check.php';
|
require __DIR__ . '/platform_check.php';
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader'));
|
||||||
|
|
||||||
$includePaths = require __DIR__ . '/include_paths.php';
|
$includePaths = require __DIR__ . '/include_paths.php';
|
||||||
$includePaths[] = get_include_path();
|
$includePaths[] = get_include_path();
|
||||||
set_include_path(implode(PATH_SEPARATOR, $includePaths));
|
set_include_path(implode(PATH_SEPARATOR, $includePaths));
|
||||||
|
|
||||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
require __DIR__ . '/autoload_static.php';
|
||||||
if ($useStaticLoader) {
|
call_user_func(\Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::getInitializer($loader));
|
||||||
require __DIR__ . '/autoload_static.php';
|
|
||||||
|
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::getInitializer($loader));
|
|
||||||
} else {
|
|
||||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
|
||||||
if ($classMap) {
|
|
||||||
$loader->addClassMap($classMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$loader->setClassMapAuthoritative(true);
|
$loader->setClassMapAuthoritative(true);
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
if ($useStaticLoader) {
|
$includeFiles = \Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::$files;
|
||||||
$includeFiles = Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::$files;
|
|
||||||
} else {
|
|
||||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
|
||||||
}
|
|
||||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||||
composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file);
|
composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
@@ -60,11 +47,16 @@ class ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $fileIdentifier
|
||||||
|
* @param string $file
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file)
|
function composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file)
|
||||||
{
|
{
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
require $file;
|
|
||||||
|
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
|
require $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,22 +7,21 @@ namespace Composer\Autoload;
|
|||||||
class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
|
||||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||||
|
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
|
|
||||||
'23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
|
'23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
|
||||||
|
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
|
||||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
|
||||||
'c9d07b32a2e02bc0fc582d4f0c1b56cc' => __DIR__ . '/..' . '/laminas/laminas-servicemanager/src/autoload.php',
|
|
||||||
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||||
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||||
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
|
|
||||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
|
|
||||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||||
|
'c9d07b32a2e02bc0fc582d4f0c1b56cc' => __DIR__ . '/..' . '/laminas/laminas-servicemanager/src/autoload.php',
|
||||||
|
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||||
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||||
|
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
|
||||||
);
|
);
|
||||||
|
|
||||||
public static $prefixLengthsPsr4 = array (
|
public static $prefixLengthsPsr4 = array (
|
||||||
@@ -814,7 +813,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
|||||||
'Combodo\\iTop\\Service\\Events\\EventServiceLog' => __DIR__ . '/../..' . '/sources/Service/Events/EventServiceLog.php',
|
'Combodo\\iTop\\Service\\Events\\EventServiceLog' => __DIR__ . '/../..' . '/sources/Service/Events/EventServiceLog.php',
|
||||||
'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => __DIR__ . '/../..' . '/sources/Service/Events/iEventServiceSetup.php',
|
'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => __DIR__ . '/../..' . '/sources/Service/Events/iEventServiceSetup.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetDataTransformer.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetDataTransformer.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetHelper' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetHelper.php',
|
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetModel' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetModel.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetModel' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetModel.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetRepository.php',
|
'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetRepository.php',
|
||||||
'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => __DIR__ . '/../..' . '/sources/Service/Links/LinksBulkDataPostProcessor.php',
|
'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => __DIR__ . '/../..' . '/sources/Service/Links/LinksBulkDataPostProcessor.php',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// include_paths.php @generated by Composer
|
// include_paths.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(dirname(__FILE__));
|
$vendorDir = dirname(__DIR__);
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
@@ -220,23 +220,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "7.4.5",
|
"version": "7.7.0",
|
||||||
"version_normalized": "7.4.5.0",
|
"version_normalized": "7.7.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/guzzle.git",
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
"reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
|
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
|
||||||
"reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
|
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"guzzlehttp/promises": "^1.5",
|
"guzzlehttp/promises": "^1.5.3 || ^2.0",
|
||||||
"guzzlehttp/psr7": "^1.9 || ^2.4",
|
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"psr/http-client": "^1.0",
|
"psr/http-client": "^1.0",
|
||||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||||
@@ -245,10 +245,11 @@
|
|||||||
"psr/http-client-implementation": "1.0"
|
"psr/http-client-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"php-http/client-integration-tests": "^3.0",
|
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
|
||||||
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
|
"php-http/message-factory": "^1.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
|
||||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@@ -256,11 +257,12 @@
|
|||||||
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
||||||
"psr/log": "Required for using the Log middleware"
|
"psr/log": "Required for using the Log middleware"
|
||||||
},
|
},
|
||||||
"time": "2022-06-20T22:16:13+00:00",
|
"time": "2023-05-21T14:04:53+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "7.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
@@ -327,7 +329,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
"source": "https://github.com/guzzle/guzzle/tree/7.4.5"
|
"source": "https://github.com/guzzle/guzzle/tree/7.7.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -347,37 +349,36 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/promises",
|
"name": "guzzlehttp/promises",
|
||||||
"version": "1.5.1",
|
"version": "2.0.0",
|
||||||
"version_normalized": "1.5.1.0",
|
"version_normalized": "2.0.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/promises.git",
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
|
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
|
||||||
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5"
|
"php": "^7.2.5 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "^4.4 || ^5.1"
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"time": "2021-10-22T20:56:57+00:00",
|
"time": "2023-05-21T13:50:22+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "1.5-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
|
||||||
"src/functions_include.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GuzzleHttp\\Promise\\": "src/"
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
}
|
}
|
||||||
@@ -414,7 +415,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/promises/issues",
|
"issues": "https://github.com/guzzle/promises/issues",
|
||||||
"source": "https://github.com/guzzle/promises/tree/1.5.1"
|
"source": "https://github.com/guzzle/promises/tree/2.0.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -434,23 +435,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "2.4.0",
|
"version": "2.5.0",
|
||||||
"version_normalized": "2.4.0.0",
|
"version_normalized": "2.5.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "13388f00956b1503577598873fffb5ae994b5737"
|
"reference": "b635f279edd83fc275f822a1188157ffea568ff6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
|
||||||
"reference": "13388f00956b1503577598873fffb5ae994b5737",
|
"reference": "b635f279edd83fc275f822a1188157ffea568ff6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"psr/http-factory": "^1.0",
|
"psr/http-factory": "^1.0",
|
||||||
"psr/http-message": "^1.0",
|
"psr/http-message": "^1.1 || ^2.0",
|
||||||
"ralouphie/getallheaders": "^3.0"
|
"ralouphie/getallheaders": "^3.0"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
@@ -458,18 +459,19 @@
|
|||||||
"psr/http-message-implementation": "1.0"
|
"psr/http-message-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"http-interop/http-factory-tests": "^0.9",
|
"http-interop/http-factory-tests": "^0.9",
|
||||||
"phpunit/phpunit": "^8.5.8 || ^9.3.10"
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
||||||
},
|
},
|
||||||
"time": "2022-06-20T21:43:11+00:00",
|
"time": "2023-04-17T16:11:26+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "2.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
@@ -532,7 +534,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
"source": "https://github.com/guzzle/psr7/tree/2.4.0"
|
"source": "https://github.com/guzzle/psr7/tree/2.5.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1731,24 +1733,24 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-client",
|
"name": "psr/http-client",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"version_normalized": "1.0.1.0",
|
"version_normalized": "1.0.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-client.git",
|
"url": "https://github.com/php-fig/http-client.git",
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.0 || ^8.0",
|
"php": "^7.0 || ^8.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"time": "2020-06-29T06:28:15+00:00",
|
"time": "2023-04-10T20:12:12+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
@@ -1768,7 +1770,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP clients",
|
"description": "Common interface for HTTP clients",
|
||||||
@@ -1780,30 +1782,30 @@
|
|||||||
"psr-18"
|
"psr-18"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
|
||||||
},
|
},
|
||||||
"install-path": "../psr/http-client"
|
"install-path": "../psr/http-client"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-factory",
|
"name": "psr/http-factory",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"version_normalized": "1.0.1.0",
|
"version_normalized": "1.0.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-factory.git",
|
"url": "https://github.com/php-fig/http-factory.git",
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
|
"reference": "e616d01114759c4c489f93b099585439f795fe35"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
"reference": "e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": ">=7.0.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"time": "2019-04-30T12:38:16+00:00",
|
"time": "2023-04-10T20:10:41+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
@@ -1823,7 +1825,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interfaces for PSR-7 HTTP message factories",
|
"description": "Common interfaces for PSR-7 HTTP message factories",
|
||||||
@@ -1838,33 +1840,33 @@
|
|||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-factory/tree/master"
|
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
|
||||||
},
|
},
|
||||||
"install-path": "../psr/http-factory"
|
"install-path": "../psr/http-factory"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-message",
|
||||||
"version": "1.0.1",
|
"version": "2.0",
|
||||||
"version_normalized": "1.0.1.0",
|
"version_normalized": "2.0.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
"url": "https://github.com/php-fig/http-message.git",
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0"
|
"php": "^7.2 || ^8.0"
|
||||||
},
|
},
|
||||||
"time": "2016-08-06T14:39:51+00:00",
|
"time": "2023-04-04T09:54:51+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.0.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
@@ -1880,7 +1882,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP messages",
|
"description": "Common interface for HTTP messages",
|
||||||
@@ -1894,7 +1896,7 @@
|
|||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-message/tree/master"
|
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||||
},
|
},
|
||||||
"install-path": "../psr/http-message"
|
"install-path": "../psr/http-message"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
|
'name' => 'combodo/itop',
|
||||||
'pretty_version' => 'dev-develop',
|
'pretty_version' => 'dev-develop',
|
||||||
'version' => 'dev-develop',
|
'version' => 'dev-develop',
|
||||||
|
'reference' => '68a1c0f0cb5742f05a3a95ae016750208a933612',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd0e6572fd0f88f05aa45e840a0311c2a0595d51a',
|
|
||||||
'name' => 'combodo/itop',
|
|
||||||
'dev' => true,
|
'dev' => true,
|
||||||
),
|
),
|
||||||
'versions' => array(
|
'versions' => array(
|
||||||
'apereo/phpcas' => array(
|
'apereo/phpcas' => array(
|
||||||
'pretty_version' => '1.6.0',
|
'pretty_version' => '1.6.0',
|
||||||
'version' => '1.6.0.0',
|
'version' => '1.6.0.0',
|
||||||
|
'reference' => 'f817c72a961484afef95ac64a9257c8e31f063b9',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../apereo/phpcas',
|
'install_path' => __DIR__ . '/../apereo/phpcas',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'f817c72a961484afef95ac64a9257c8e31f063b9',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'combodo/itop' => array(
|
'combodo/itop' => array(
|
||||||
'pretty_version' => 'dev-develop',
|
'pretty_version' => 'dev-develop',
|
||||||
'version' => 'dev-develop',
|
'version' => 'dev-develop',
|
||||||
|
'reference' => '68a1c0f0cb5742f05a3a95ae016750208a933612',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd0e6572fd0f88f05aa45e840a0311c2a0595d51a',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'combodo/tcpdf' => array(
|
'combodo/tcpdf' => array(
|
||||||
'pretty_version' => '6.4.4',
|
'pretty_version' => '6.4.4',
|
||||||
'version' => '6.4.4.0',
|
'version' => '6.4.4.0',
|
||||||
|
'reference' => '0e31c013ccd000aa6762e9186778aa6e259ac8e8',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../combodo/tcpdf',
|
'install_path' => __DIR__ . '/../combodo/tcpdf',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '0e31c013ccd000aa6762e9186778aa6e259ac8e8',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'container-interop/container-interop' => array(
|
'container-interop/container-interop' => array(
|
||||||
@@ -46,181 +46,181 @@
|
|||||||
'firebase/php-jwt' => array(
|
'firebase/php-jwt' => array(
|
||||||
'pretty_version' => 'v6.4.0',
|
'pretty_version' => 'v6.4.0',
|
||||||
'version' => '6.4.0.0',
|
'version' => '6.4.0.0',
|
||||||
|
'reference' => '4dd1e007f22a927ac77da5a3fbb067b42d3bc224',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../firebase/php-jwt',
|
'install_path' => __DIR__ . '/../firebase/php-jwt',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '4dd1e007f22a927ac77da5a3fbb067b42d3bc224',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/guzzle' => array(
|
'guzzlehttp/guzzle' => array(
|
||||||
'pretty_version' => '7.4.5',
|
'pretty_version' => '7.7.0',
|
||||||
'version' => '7.4.5.0',
|
'version' => '7.7.0.0',
|
||||||
|
'reference' => 'fb7566caccf22d74d1ab270de3551f72a58399f5',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
|
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '1dd98b0564cb3f6bd16ce683cb755f94c10fbd82',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/promises' => array(
|
'guzzlehttp/promises' => array(
|
||||||
'pretty_version' => '1.5.1',
|
'pretty_version' => '2.0.0',
|
||||||
'version' => '1.5.1.0',
|
'version' => '2.0.0.0',
|
||||||
|
'reference' => '3a494dc7dc1d7d12e511890177ae2d0e6c107da6',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/psr7' => array(
|
'guzzlehttp/psr7' => array(
|
||||||
'pretty_version' => '2.4.0',
|
'pretty_version' => '2.5.0',
|
||||||
'version' => '2.4.0.0',
|
'version' => '2.5.0.0',
|
||||||
|
'reference' => 'b635f279edd83fc275f822a1188157ffea568ff6',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
|
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '13388f00956b1503577598873fffb5ae994b5737',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-loader' => array(
|
'laminas/laminas-loader' => array(
|
||||||
'pretty_version' => '2.8.0',
|
'pretty_version' => '2.8.0',
|
||||||
'version' => '2.8.0.0',
|
'version' => '2.8.0.0',
|
||||||
|
'reference' => 'd0589ec9dd48365fd95ad10d1c906efd7711c16b',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-loader',
|
'install_path' => __DIR__ . '/../laminas/laminas-loader',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd0589ec9dd48365fd95ad10d1c906efd7711c16b',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-mail' => array(
|
'laminas/laminas-mail' => array(
|
||||||
'pretty_version' => '2.16.0',
|
'pretty_version' => '2.16.0',
|
||||||
'version' => '2.16.0.0',
|
'version' => '2.16.0.0',
|
||||||
|
'reference' => '1ee1a384b96c8af29ecad9b3a7adc27a150ebc49',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-mail',
|
'install_path' => __DIR__ . '/../laminas/laminas-mail',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '1ee1a384b96c8af29ecad9b3a7adc27a150ebc49',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-mime' => array(
|
'laminas/laminas-mime' => array(
|
||||||
'pretty_version' => '2.9.1',
|
'pretty_version' => '2.9.1',
|
||||||
'version' => '2.9.1.0',
|
'version' => '2.9.1.0',
|
||||||
|
'reference' => '72d21a1b4bb7086d4a4d7058c0abca180b209184',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-mime',
|
'install_path' => __DIR__ . '/../laminas/laminas-mime',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '72d21a1b4bb7086d4a4d7058c0abca180b209184',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-servicemanager' => array(
|
'laminas/laminas-servicemanager' => array(
|
||||||
'pretty_version' => '3.16.0',
|
'pretty_version' => '3.16.0',
|
||||||
'version' => '3.16.0.0',
|
'version' => '3.16.0.0',
|
||||||
|
'reference' => '863c66733740cd36ebf5e700f4258ef2c68a2a24',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-servicemanager',
|
'install_path' => __DIR__ . '/../laminas/laminas-servicemanager',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '863c66733740cd36ebf5e700f4258ef2c68a2a24',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-stdlib' => array(
|
'laminas/laminas-stdlib' => array(
|
||||||
'pretty_version' => '3.12.0',
|
'pretty_version' => '3.12.0',
|
||||||
'version' => '3.12.0.0',
|
'version' => '3.12.0.0',
|
||||||
|
'reference' => 'c5aed3c798018e31fbb7b1e421b8d96bf2cda453',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-stdlib',
|
'install_path' => __DIR__ . '/../laminas/laminas-stdlib',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'c5aed3c798018e31fbb7b1e421b8d96bf2cda453',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'laminas/laminas-validator' => array(
|
'laminas/laminas-validator' => array(
|
||||||
'pretty_version' => '2.23.0',
|
'pretty_version' => '2.23.0',
|
||||||
'version' => '2.23.0.0',
|
'version' => '2.23.0.0',
|
||||||
|
'reference' => '6d61b6cc3b222f13807a18d9247cdfb084958b03',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../laminas/laminas-validator',
|
'install_path' => __DIR__ . '/../laminas/laminas-validator',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '6d61b6cc3b222f13807a18d9247cdfb084958b03',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'league/oauth2-client' => array(
|
'league/oauth2-client' => array(
|
||||||
'pretty_version' => '2.6.1',
|
'pretty_version' => '2.6.1',
|
||||||
'version' => '2.6.1.0',
|
'version' => '2.6.1.0',
|
||||||
|
'reference' => '2334c249907190c132364f5dae0287ab8666aa19',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../league/oauth2-client',
|
'install_path' => __DIR__ . '/../league/oauth2-client',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '2334c249907190c132364f5dae0287ab8666aa19',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'league/oauth2-google' => array(
|
'league/oauth2-google' => array(
|
||||||
'pretty_version' => '3.0.4',
|
'pretty_version' => '3.0.4',
|
||||||
'version' => '3.0.4.0',
|
'version' => '3.0.4.0',
|
||||||
|
'reference' => '6b79441f244040760bed5fdcd092a2bda7cf34c6',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../league/oauth2-google',
|
'install_path' => __DIR__ . '/../league/oauth2-google',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '6b79441f244040760bed5fdcd092a2bda7cf34c6',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'nikic/php-parser' => array(
|
'nikic/php-parser' => array(
|
||||||
'pretty_version' => 'v4.14.0',
|
'pretty_version' => 'v4.14.0',
|
||||||
'version' => '4.14.0.0',
|
'version' => '4.14.0.0',
|
||||||
|
'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../nikic/php-parser',
|
'install_path' => __DIR__ . '/../nikic/php-parser',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'paragonie/random_compat' => array(
|
'paragonie/random_compat' => array(
|
||||||
'pretty_version' => 'v9.99.100',
|
'pretty_version' => 'v9.99.100',
|
||||||
'version' => '9.99.100.0',
|
'version' => '9.99.100.0',
|
||||||
|
'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../paragonie/random_compat',
|
'install_path' => __DIR__ . '/../paragonie/random_compat',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pear/archive_tar' => array(
|
'pear/archive_tar' => array(
|
||||||
'pretty_version' => '1.4.14',
|
'pretty_version' => '1.4.14',
|
||||||
'version' => '1.4.14.0',
|
'version' => '1.4.14.0',
|
||||||
|
'reference' => '4d761c5334c790e45ef3245f0864b8955c562caa',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../pear/archive_tar',
|
'install_path' => __DIR__ . '/../pear/archive_tar',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '4d761c5334c790e45ef3245f0864b8955c562caa',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pear/console_getopt' => array(
|
'pear/console_getopt' => array(
|
||||||
'pretty_version' => 'v1.4.3',
|
'pretty_version' => 'v1.4.3',
|
||||||
'version' => '1.4.3.0',
|
'version' => '1.4.3.0',
|
||||||
|
'reference' => 'a41f8d3e668987609178c7c4a9fe48fecac53fa0',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../pear/console_getopt',
|
'install_path' => __DIR__ . '/../pear/console_getopt',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'a41f8d3e668987609178c7c4a9fe48fecac53fa0',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pear/pear-core-minimal' => array(
|
'pear/pear-core-minimal' => array(
|
||||||
'pretty_version' => 'v1.10.11',
|
'pretty_version' => 'v1.10.11',
|
||||||
'version' => '1.10.11.0',
|
'version' => '1.10.11.0',
|
||||||
|
'reference' => '68d0d32ada737153b7e93b8d3c710ebe70ac867d',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../pear/pear-core-minimal',
|
'install_path' => __DIR__ . '/../pear/pear-core-minimal',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '68d0d32ada737153b7e93b8d3c710ebe70ac867d',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pear/pear_exception' => array(
|
'pear/pear_exception' => array(
|
||||||
'pretty_version' => 'v1.0.2',
|
'pretty_version' => 'v1.0.2',
|
||||||
'version' => '1.0.2.0',
|
'version' => '1.0.2.0',
|
||||||
|
'reference' => 'b14fbe2ddb0b9f94f5b24cf08783d599f776fff0',
|
||||||
'type' => 'class',
|
'type' => 'class',
|
||||||
'install_path' => __DIR__ . '/../pear/pear_exception',
|
'install_path' => __DIR__ . '/../pear/pear_exception',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'b14fbe2ddb0b9f94f5b24cf08783d599f776fff0',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pelago/emogrifier' => array(
|
'pelago/emogrifier' => array(
|
||||||
'pretty_version' => 'v6.0.0',
|
'pretty_version' => 'v6.0.0',
|
||||||
'version' => '6.0.0.0',
|
'version' => '6.0.0.0',
|
||||||
|
'reference' => 'aa72d5407efac118f3896bcb995a2cba793df0ae',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../pelago/emogrifier',
|
'install_path' => __DIR__ . '/../pelago/emogrifier',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'aa72d5407efac118f3896bcb995a2cba793df0ae',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/cache' => array(
|
'psr/cache' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '1.0.1',
|
||||||
'version' => '1.0.1.0',
|
'version' => '1.0.1.0',
|
||||||
|
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/cache',
|
'install_path' => __DIR__ . '/../psr/cache',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/cache-implementation' => array(
|
'psr/cache-implementation' => array(
|
||||||
@@ -232,10 +232,10 @@
|
|||||||
'psr/container' => array(
|
'psr/container' => array(
|
||||||
'pretty_version' => '1.1.2',
|
'pretty_version' => '1.1.2',
|
||||||
'version' => '1.1.2.0',
|
'version' => '1.1.2.0',
|
||||||
|
'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/container',
|
'install_path' => __DIR__ . '/../psr/container',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/container-implementation' => array(
|
'psr/container-implementation' => array(
|
||||||
@@ -248,10 +248,10 @@
|
|||||||
'psr/event-dispatcher' => array(
|
'psr/event-dispatcher' => array(
|
||||||
'pretty_version' => '1.0.0',
|
'pretty_version' => '1.0.0',
|
||||||
'version' => '1.0.0.0',
|
'version' => '1.0.0.0',
|
||||||
|
'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/event-dispatcher',
|
'install_path' => __DIR__ . '/../psr/event-dispatcher',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/event-dispatcher-implementation' => array(
|
'psr/event-dispatcher-implementation' => array(
|
||||||
@@ -261,12 +261,12 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/http-client' => array(
|
'psr/http-client' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '1.0.2',
|
||||||
'version' => '1.0.1.0',
|
'version' => '1.0.2.0',
|
||||||
|
'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-client',
|
'install_path' => __DIR__ . '/../psr/http-client',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/http-client-implementation' => array(
|
'psr/http-client-implementation' => array(
|
||||||
@@ -276,12 +276,12 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/http-factory' => array(
|
'psr/http-factory' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '1.0.2',
|
||||||
'version' => '1.0.1.0',
|
'version' => '1.0.2.0',
|
||||||
|
'reference' => 'e616d01114759c4c489f93b099585439f795fe35',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-factory',
|
'install_path' => __DIR__ . '/../psr/http-factory',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/http-factory-implementation' => array(
|
'psr/http-factory-implementation' => array(
|
||||||
@@ -291,12 +291,12 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/http-message' => array(
|
'psr/http-message' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '2.0',
|
||||||
'version' => '1.0.1.0',
|
'version' => '2.0.0.0',
|
||||||
|
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-message',
|
'install_path' => __DIR__ . '/../psr/http-message',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/http-message-implementation' => array(
|
'psr/http-message-implementation' => array(
|
||||||
@@ -308,10 +308,10 @@
|
|||||||
'psr/log' => array(
|
'psr/log' => array(
|
||||||
'pretty_version' => '1.1.4',
|
'pretty_version' => '1.1.4',
|
||||||
'version' => '1.1.4.0',
|
'version' => '1.1.4.0',
|
||||||
|
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/log',
|
'install_path' => __DIR__ . '/../psr/log',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/log-implementation' => array(
|
'psr/log-implementation' => array(
|
||||||
@@ -329,10 +329,10 @@
|
|||||||
'ralouphie/getallheaders' => array(
|
'ralouphie/getallheaders' => array(
|
||||||
'pretty_version' => '3.0.3',
|
'pretty_version' => '3.0.3',
|
||||||
'version' => '3.0.3.0',
|
'version' => '3.0.3.0',
|
||||||
|
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
|
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'rsky/pear-core-min' => array(
|
'rsky/pear-core-min' => array(
|
||||||
@@ -344,37 +344,37 @@
|
|||||||
'sabberworm/php-css-parser' => array(
|
'sabberworm/php-css-parser' => array(
|
||||||
'pretty_version' => '8.4.0',
|
'pretty_version' => '8.4.0',
|
||||||
'version' => '8.4.0.0',
|
'version' => '8.4.0.0',
|
||||||
|
'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../sabberworm/php-css-parser',
|
'install_path' => __DIR__ . '/../sabberworm/php-css-parser',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'scssphp/scssphp' => array(
|
'scssphp/scssphp' => array(
|
||||||
'pretty_version' => 'v1.10.5',
|
'pretty_version' => 'v1.10.5',
|
||||||
'version' => '1.10.5.0',
|
'version' => '1.10.5.0',
|
||||||
|
'reference' => '6d44282ccf283e133ab70b6282f8e068ff2f9bf9',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../scssphp/scssphp',
|
'install_path' => __DIR__ . '/../scssphp/scssphp',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '6d44282ccf283e133ab70b6282f8e068ff2f9bf9',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/cache' => array(
|
'symfony/cache' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '5a0fff46df349f0db3fe242263451fddf5277362',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/cache',
|
'install_path' => __DIR__ . '/../symfony/cache',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '5a0fff46df349f0db3fe242263451fddf5277362',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/cache-contracts' => array(
|
'symfony/cache-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v2.5.2',
|
||||||
'version' => '2.5.2.0',
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => '64be4a7acb83b6f2bf6de9a02cee6dad41277ebc',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/cache-contracts',
|
'install_path' => __DIR__ . '/../symfony/cache-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '64be4a7acb83b6f2bf6de9a02cee6dad41277ebc',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/cache-implementation' => array(
|
'symfony/cache-implementation' => array(
|
||||||
@@ -386,82 +386,82 @@
|
|||||||
'symfony/config' => array(
|
'symfony/config' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => 'ec79e03125c1d2477e43dde8528535d90cc78379',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/config',
|
'install_path' => __DIR__ . '/../symfony/config',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'ec79e03125c1d2477e43dde8528535d90cc78379',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/console' => array(
|
'symfony/console' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => 'dccb8d251a9017d5994c988b034d3e18aaabf740',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/console',
|
'install_path' => __DIR__ . '/../symfony/console',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'dccb8d251a9017d5994c988b034d3e18aaabf740',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/css-selector' => array(
|
'symfony/css-selector' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => 'c1681789f059ab756001052164726ae88512ae3d',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/css-selector',
|
'install_path' => __DIR__ . '/../symfony/css-selector',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'c1681789f059ab756001052164726ae88512ae3d',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/dependency-injection' => array(
|
'symfony/dependency-injection' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => 'a8b9251016e9476db73e25fa836904bc0bf74c62',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/dependency-injection',
|
'install_path' => __DIR__ . '/../symfony/dependency-injection',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'a8b9251016e9476db73e25fa836904bc0bf74c62',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/deprecation-contracts' => array(
|
'symfony/deprecation-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v2.5.2',
|
||||||
'version' => '2.5.2.0',
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/dotenv' => array(
|
'symfony/dotenv' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => '38190ba62566afa26ca723a795d0a004e061bd2a',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/dotenv',
|
'install_path' => __DIR__ . '/../symfony/dotenv',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '38190ba62566afa26ca723a795d0a004e061bd2a',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/error-handler' => array(
|
'symfony/error-handler' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => 'f75d17cb4769eb38cd5fccbda95cd80a054d35c8',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/error-handler',
|
'install_path' => __DIR__ . '/../symfony/error-handler',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'f75d17cb4769eb38cd5fccbda95cd80a054d35c8',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/event-dispatcher' => array(
|
'symfony/event-dispatcher' => array(
|
||||||
'pretty_version' => 'v5.4.9',
|
'pretty_version' => 'v5.4.9',
|
||||||
'version' => '5.4.9.0',
|
'version' => '5.4.9.0',
|
||||||
|
'reference' => '8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
|
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/event-dispatcher-contracts' => array(
|
'symfony/event-dispatcher-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v2.5.2',
|
||||||
'version' => '2.5.2.0',
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => 'f98b54df6ad059855739db6fcbc2d36995283fe1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
|
'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'f98b54df6ad059855739db6fcbc2d36995283fe1',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/event-dispatcher-implementation' => array(
|
'symfony/event-dispatcher-implementation' => array(
|
||||||
@@ -473,145 +473,145 @@
|
|||||||
'symfony/filesystem' => array(
|
'symfony/filesystem' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '6699fb0228d1bc35b12aed6dd5e7455457609ddd',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/filesystem',
|
'install_path' => __DIR__ . '/../symfony/filesystem',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '6699fb0228d1bc35b12aed6dd5e7455457609ddd',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/finder' => array(
|
'symfony/finder' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '7872a66f57caffa2916a584db1aa7f12adc76f8c',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/finder',
|
'install_path' => __DIR__ . '/../symfony/finder',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '7872a66f57caffa2916a584db1aa7f12adc76f8c',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/framework-bundle' => array(
|
'symfony/framework-bundle' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => 'a208ee578000f9dedcb50a9784ec7ff8706a7bf1',
|
||||||
'type' => 'symfony-bundle',
|
'type' => 'symfony-bundle',
|
||||||
'install_path' => __DIR__ . '/../symfony/framework-bundle',
|
'install_path' => __DIR__ . '/../symfony/framework-bundle',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'a208ee578000f9dedcb50a9784ec7ff8706a7bf1',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/http-foundation' => array(
|
'symfony/http-foundation' => array(
|
||||||
'pretty_version' => 'v5.4.20',
|
'pretty_version' => 'v5.4.20',
|
||||||
'version' => '5.4.20.0',
|
'version' => '5.4.20.0',
|
||||||
|
'reference' => 'd0435363362a47c14e9cf50663cb8ffbf491875a',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/http-foundation',
|
'install_path' => __DIR__ . '/../symfony/http-foundation',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'd0435363362a47c14e9cf50663cb8ffbf491875a',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/http-kernel' => array(
|
'symfony/http-kernel' => array(
|
||||||
'pretty_version' => 'v5.4.20',
|
'pretty_version' => 'v5.4.20',
|
||||||
'version' => '5.4.20.0',
|
'version' => '5.4.20.0',
|
||||||
|
'reference' => 'aaeec341582d3c160cc9ecfa8b2419ba6c69954e',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/http-kernel',
|
'install_path' => __DIR__ . '/../symfony/http-kernel',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'aaeec341582d3c160cc9ecfa8b2419ba6c69954e',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-ctype' => array(
|
'symfony/polyfill-ctype' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-intl-grapheme' => array(
|
'symfony/polyfill-intl-grapheme' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '433d05519ce6990bf3530fba6957499d327395c2',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
|
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '433d05519ce6990bf3530fba6957499d327395c2',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-intl-idn' => array(
|
'symfony/polyfill-intl-idn' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '59a8d271f00dd0e4c2e518104cc7963f655a1aa8',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn',
|
'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '59a8d271f00dd0e4c2e518104cc7963f655a1aa8',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-intl-normalizer' => array(
|
'symfony/polyfill-intl-normalizer' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '219aa369ceff116e673852dce47c3a41794c14bd',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
|
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '219aa369ceff116e673852dce47c3a41794c14bd',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-mbstring' => array(
|
'symfony/polyfill-mbstring' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-php72' => array(
|
'symfony/polyfill-php72' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => 'bf44a9fd41feaac72b074de600314a93e2ae78e2',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-php72',
|
'install_path' => __DIR__ . '/../symfony/polyfill-php72',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'bf44a9fd41feaac72b074de600314a93e2ae78e2',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-php73' => array(
|
'symfony/polyfill-php73' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => 'e440d35fa0286f77fb45b79a03fedbeda9307e85',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
|
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'e440d35fa0286f77fb45b79a03fedbeda9307e85',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-php80' => array(
|
'symfony/polyfill-php80' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-php81' => array(
|
'symfony/polyfill-php81' => array(
|
||||||
'pretty_version' => 'v1.26.0',
|
'pretty_version' => 'v1.26.0',
|
||||||
'version' => '1.26.0.0',
|
'version' => '1.26.0.0',
|
||||||
|
'reference' => '13f6d1271c663dc5ae9fb843a8f16521db7687a1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
|
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '13f6d1271c663dc5ae9fb843a8f16521db7687a1',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/routing' => array(
|
'symfony/routing' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '3e01ccd9b2a3a4167ba2b3c53612762300300226',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/routing',
|
'install_path' => __DIR__ . '/../symfony/routing',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '3e01ccd9b2a3a4167ba2b3c53612762300300226',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/service-contracts' => array(
|
'symfony/service-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v2.5.2',
|
||||||
'version' => '2.5.2.0',
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => '4b426aac47d6427cc1a1d0f7e2ac724627f5966c',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/service-contracts',
|
'install_path' => __DIR__ . '/../symfony/service-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '4b426aac47d6427cc1a1d0f7e2ac724627f5966c',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/service-implementation' => array(
|
'symfony/service-implementation' => array(
|
||||||
@@ -623,82 +623,82 @@
|
|||||||
'symfony/stopwatch' => array(
|
'symfony/stopwatch' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => 'bd2b066090fd6a67039371098fa25a84cb2679ec',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/stopwatch',
|
'install_path' => __DIR__ . '/../symfony/stopwatch',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'bd2b066090fd6a67039371098fa25a84cb2679ec',
|
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'symfony/string' => array(
|
'symfony/string' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '5eb661e49ad389e4ae2b6e4df8d783a8a6548322',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/string',
|
'install_path' => __DIR__ . '/../symfony/string',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '5eb661e49ad389e4ae2b6e4df8d783a8a6548322',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/translation-contracts' => array(
|
'symfony/translation-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v2.5.2',
|
||||||
'version' => '2.5.2.0',
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => '136b19dd05cdf0709db6537d058bcab6dd6e2dbe',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/translation-contracts',
|
'install_path' => __DIR__ . '/../symfony/translation-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '136b19dd05cdf0709db6537d058bcab6dd6e2dbe',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/twig-bridge' => array(
|
'symfony/twig-bridge' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => '63b8a50d48c9fe3d04e77307d4f1771dd848baa8',
|
||||||
'type' => 'symfony-bridge',
|
'type' => 'symfony-bridge',
|
||||||
'install_path' => __DIR__ . '/../symfony/twig-bridge',
|
'install_path' => __DIR__ . '/../symfony/twig-bridge',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '63b8a50d48c9fe3d04e77307d4f1771dd848baa8',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/twig-bundle' => array(
|
'symfony/twig-bundle' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => '286bd9e38b9bcb142f1eda0a75b0bbeb49ff34bd',
|
||||||
'type' => 'symfony-bundle',
|
'type' => 'symfony-bundle',
|
||||||
'install_path' => __DIR__ . '/../symfony/twig-bundle',
|
'install_path' => __DIR__ . '/../symfony/twig-bundle',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '286bd9e38b9bcb142f1eda0a75b0bbeb49ff34bd',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/var-dumper' => array(
|
'symfony/var-dumper' => array(
|
||||||
'pretty_version' => 'v5.4.11',
|
'pretty_version' => 'v5.4.11',
|
||||||
'version' => '5.4.11.0',
|
'version' => '5.4.11.0',
|
||||||
|
'reference' => 'b8f306d7b8ef34fb3db3305be97ba8e088fb4861',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/var-dumper',
|
'install_path' => __DIR__ . '/../symfony/var-dumper',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'b8f306d7b8ef34fb3db3305be97ba8e088fb4861',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/var-exporter' => array(
|
'symfony/var-exporter' => array(
|
||||||
'pretty_version' => 'v5.4.10',
|
'pretty_version' => 'v5.4.10',
|
||||||
'version' => '5.4.10.0',
|
'version' => '5.4.10.0',
|
||||||
|
'reference' => '8fc03ee75eeece3d9be1ef47d26d79bea1afb340',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/var-exporter',
|
'install_path' => __DIR__ . '/../symfony/var-exporter',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '8fc03ee75eeece3d9be1ef47d26d79bea1afb340',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/web-profiler-bundle' => array(
|
'symfony/web-profiler-bundle' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => 'cd83822071f2bc05583af1e53c1bc46be625a56d',
|
||||||
'type' => 'symfony-bundle',
|
'type' => 'symfony-bundle',
|
||||||
'install_path' => __DIR__ . '/../symfony/web-profiler-bundle',
|
'install_path' => __DIR__ . '/../symfony/web-profiler-bundle',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'cd83822071f2bc05583af1e53c1bc46be625a56d',
|
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'symfony/yaml' => array(
|
'symfony/yaml' => array(
|
||||||
'pretty_version' => 'v5.4.19',
|
'pretty_version' => 'v5.4.19',
|
||||||
'version' => '5.4.19.0',
|
'version' => '5.4.19.0',
|
||||||
|
'reference' => '71c05db20cb9b54d381a28255f17580e2b7e36a5',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/yaml',
|
'install_path' => __DIR__ . '/../symfony/yaml',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '71c05db20cb9b54d381a28255f17580e2b7e36a5',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'tecnickcom/tcpdf' => array(
|
'tecnickcom/tcpdf' => array(
|
||||||
@@ -710,28 +710,28 @@
|
|||||||
'thenetworg/oauth2-azure' => array(
|
'thenetworg/oauth2-azure' => array(
|
||||||
'pretty_version' => 'v2.1.1',
|
'pretty_version' => 'v2.1.1',
|
||||||
'version' => '2.1.1.0',
|
'version' => '2.1.1.0',
|
||||||
|
'reference' => '06fb2d620fb6e6c934f632c7ec7c5ea2e978a844',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../thenetworg/oauth2-azure',
|
'install_path' => __DIR__ . '/../thenetworg/oauth2-azure',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '06fb2d620fb6e6c934f632c7ec7c5ea2e978a844',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'twig/twig' => array(
|
'twig/twig' => array(
|
||||||
'pretty_version' => 'v3.4.3',
|
'pretty_version' => 'v3.4.3',
|
||||||
'version' => '3.4.3.0',
|
'version' => '3.4.3.0',
|
||||||
|
'reference' => 'c38fd6b0b7f370c198db91ffd02e23b517426b58',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../twig/twig',
|
'install_path' => __DIR__ . '/../twig/twig',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => 'c38fd6b0b7f370c198db91ffd02e23b517426b58',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'webmozart/assert' => array(
|
'webmozart/assert' => array(
|
||||||
'pretty_version' => '1.11.0',
|
'pretty_version' => '1.11.0',
|
||||||
'version' => '1.11.0.0',
|
'version' => '1.11.0.0',
|
||||||
|
'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../webmozart/assert',
|
'install_path' => __DIR__ . '/../webmozart/assert',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991',
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,20 +2,83 @@
|
|||||||
|
|
||||||
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
|
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
|
||||||
|
|
||||||
|
|
||||||
|
## 7.7.0 - 2023-05-21
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support `guzzlehttp/promises` v2
|
||||||
|
|
||||||
|
|
||||||
|
## 7.6.1 - 2023-05-15
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values
|
||||||
|
|
||||||
|
|
||||||
|
## 7.6.0 - 2023-05-14
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for setting the minimum TLS version in a unified way
|
||||||
|
- Apply on request the version set in options parameters
|
||||||
|
|
||||||
|
|
||||||
|
## 7.5.2 - 2023-05-14
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed set cookie constructor validation
|
||||||
|
- Fixed handling of files with `'0'` body
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Corrected docs and default connect timeout value to 300 seconds
|
||||||
|
|
||||||
|
|
||||||
|
## 7.5.1 - 2023-04-17
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `NO_PROXY` settings so that setting the `proxy` option to `no` overrides the env variable
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5`
|
||||||
|
|
||||||
|
|
||||||
|
## 7.5.0 - 2022-08-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support PHP 8.2
|
||||||
|
- Add request to delay closure params
|
||||||
|
|
||||||
|
|
||||||
## 7.4.5 - 2022-06-20
|
## 7.4.5 - 2022-06-20
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
* Fix change in port should be considered a change in origin
|
* Fix change in port should be considered a change in origin
|
||||||
* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin
|
* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin
|
||||||
|
|
||||||
|
|
||||||
## 7.4.4 - 2022-06-09
|
## 7.4.4 - 2022-06-09
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
* Fix failure to strip Authorization header on HTTP downgrade
|
* Fix failure to strip Authorization header on HTTP downgrade
|
||||||
* Fix failure to strip the Cookie header on change in host or HTTP downgrade
|
* Fix failure to strip the Cookie header on change in host or HTTP downgrade
|
||||||
|
|
||||||
|
|
||||||
## 7.4.3 - 2022-05-25
|
## 7.4.3 - 2022-05-25
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
* Fix cross-domain cookie leakage
|
* Fix cross-domain cookie leakage
|
||||||
|
|
||||||
|
|
||||||
## 7.4.2 - 2022-03-20
|
## 7.4.2 - 2022-03-20
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -24,6 +87,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
- Reject non-HTTP schemes in StreamHandler
|
- Reject non-HTTP schemes in StreamHandler
|
||||||
- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve`
|
- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve`
|
||||||
|
|
||||||
|
|
||||||
## 7.4.1 - 2021-12-06
|
## 7.4.1 - 2021-12-06
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
@@ -35,6 +99,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
|
|
||||||
- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950)
|
- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950)
|
||||||
|
|
||||||
|
|
||||||
## 7.4.0 - 2021-10-18
|
## 7.4.0 - 2021-10-18
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -52,6 +117,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
|
|
||||||
- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945)
|
- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945)
|
||||||
|
|
||||||
|
|
||||||
## 7.3.0 - 2021-03-23
|
## 7.3.0 - 2021-03-23
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -64,6 +130,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
|
|
||||||
- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872)
|
- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872)
|
||||||
|
|
||||||
|
|
||||||
## 7.2.0 - 2020-10-10
|
## 7.2.0 - 2020-10-10
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -86,6 +153,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
|
|
||||||
- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786)
|
- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786)
|
||||||
|
|
||||||
|
|
||||||
## 7.1.1 - 2020-09-30
|
## 7.1.1 - 2020-09-30
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -97,6 +165,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
- We dont connect curl `sink` on HEAD requests.
|
- We dont connect curl `sink` on HEAD requests.
|
||||||
- Removed some PHP 5 workarounds
|
- Removed some PHP 5 workarounds
|
||||||
|
|
||||||
|
|
||||||
## 7.1.0 - 2020-09-22
|
## 7.1.0 - 2020-09-22
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -119,14 +188,17 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
|
|||||||
- `Utils::defaultCaBundle()`
|
- `Utils::defaultCaBundle()`
|
||||||
- `CurlFactory::LOW_CURL_VERSION_NUMBER`
|
- `CurlFactory::LOW_CURL_VERSION_NUMBER`
|
||||||
|
|
||||||
|
|
||||||
## 7.0.1 - 2020-06-27
|
## 7.0.1 - 2020-06-27
|
||||||
|
|
||||||
* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699)
|
* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699)
|
||||||
|
|
||||||
|
|
||||||
## 7.0.0 - 2020-06-27
|
## 7.0.0 - 2020-06-27
|
||||||
|
|
||||||
No changes since 7.0.0-rc1.
|
No changes since 7.0.0-rc1.
|
||||||
|
|
||||||
|
|
||||||
## 7.0.0-rc1 - 2020-06-15
|
## 7.0.0-rc1 - 2020-06-15
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
@@ -134,6 +206,7 @@ No changes since 7.0.0-rc1.
|
|||||||
* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629)
|
* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629)
|
||||||
* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675)
|
* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675)
|
||||||
|
|
||||||
|
|
||||||
## 7.0.0-beta2 - 2020-05-25
|
## 7.0.0-beta2 - 2020-05-25
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -159,6 +232,7 @@ No changes since 7.0.0-rc1.
|
|||||||
|
|
||||||
* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528)
|
* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528)
|
||||||
|
|
||||||
|
|
||||||
## 7.0.0-beta1 - 2019-12-30
|
## 7.0.0-beta1 - 2019-12-30
|
||||||
|
|
||||||
The diff might look very big but 95% of Guzzle users will be able to upgrade without modification.
|
The diff might look very big but 95% of Guzzle users will be able to upgrade without modification.
|
||||||
@@ -192,15 +266,18 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440)
|
* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440)
|
||||||
* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464)
|
* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464)
|
||||||
|
|
||||||
|
|
||||||
## 6.5.2 - 2019-12-23
|
## 6.5.2 - 2019-12-23
|
||||||
|
|
||||||
* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)
|
* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)
|
||||||
|
|
||||||
|
|
||||||
## 6.5.1 - 2019-12-21
|
## 6.5.1 - 2019-12-21
|
||||||
|
|
||||||
* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454)
|
* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454)
|
||||||
* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424)
|
* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424)
|
||||||
|
|
||||||
|
|
||||||
## 6.5.0 - 2019-12-07
|
## 6.5.0 - 2019-12-07
|
||||||
|
|
||||||
* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143)
|
* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143)
|
||||||
@@ -210,11 +287,13 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348)
|
* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348)
|
||||||
* Deprecated `ClientInterface::VERSION`
|
* Deprecated `ClientInterface::VERSION`
|
||||||
|
|
||||||
|
|
||||||
## 6.4.1 - 2019-10-23
|
## 6.4.1 - 2019-10-23
|
||||||
|
|
||||||
* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
|
* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
|
||||||
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
|
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
|
||||||
|
|
||||||
|
|
||||||
## 6.4.0 - 2019-10-23
|
## 6.4.0 - 2019-10-23
|
||||||
|
|
||||||
* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
|
* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
|
||||||
@@ -227,6 +306,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
|
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
|
||||||
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)
|
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)
|
||||||
|
|
||||||
|
|
||||||
## 6.3.3 - 2018-04-22
|
## 6.3.3 - 2018-04-22
|
||||||
|
|
||||||
* Fix: Default headers when decode_content is specified
|
* Fix: Default headers when decode_content is specified
|
||||||
@@ -268,13 +348,14 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684)
|
* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684)
|
||||||
* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827)
|
* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827)
|
||||||
|
|
||||||
|
|
||||||
+ Minor code cleanups, documentation fixes and clarifications.
|
+ Minor code cleanups, documentation fixes and clarifications.
|
||||||
|
|
||||||
|
|
||||||
## 6.2.3 - 2017-02-28
|
## 6.2.3 - 2017-02-28
|
||||||
|
|
||||||
* Fix deprecations with guzzle/psr7 version 1.4
|
* Fix deprecations with guzzle/psr7 version 1.4
|
||||||
|
|
||||||
|
|
||||||
## 6.2.2 - 2016-10-08
|
## 6.2.2 - 2016-10-08
|
||||||
|
|
||||||
* Allow to pass nullable Response to delay callable
|
* Allow to pass nullable Response to delay callable
|
||||||
@@ -282,6 +363,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Fix drain case where content-length is the literal string zero
|
* Fix drain case where content-length is the literal string zero
|
||||||
* Obfuscate in-URL credentials in exceptions
|
* Obfuscate in-URL credentials in exceptions
|
||||||
|
|
||||||
|
|
||||||
## 6.2.1 - 2016-07-18
|
## 6.2.1 - 2016-07-18
|
||||||
|
|
||||||
* Address HTTP_PROXY security vulnerability, CVE-2016-5385:
|
* Address HTTP_PROXY security vulnerability, CVE-2016-5385:
|
||||||
@@ -292,6 +374,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
a server does not honor `Connection: close`.
|
a server does not honor `Connection: close`.
|
||||||
* Ignore URI fragment when sending requests.
|
* Ignore URI fragment when sending requests.
|
||||||
|
|
||||||
|
|
||||||
## 6.2.0 - 2016-03-21
|
## 6.2.0 - 2016-03-21
|
||||||
|
|
||||||
* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`.
|
* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`.
|
||||||
@@ -311,6 +394,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Bug fix: provide an empty string to `http_build_query` for HHVM workaround.
|
* Bug fix: provide an empty string to `http_build_query` for HHVM workaround.
|
||||||
https://github.com/guzzle/guzzle/pull/1367
|
https://github.com/guzzle/guzzle/pull/1367
|
||||||
|
|
||||||
|
|
||||||
## 6.1.1 - 2015-11-22
|
## 6.1.1 - 2015-11-22
|
||||||
|
|
||||||
* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler
|
* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler
|
||||||
@@ -326,6 +410,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Bug fix: fixed regression where MockHandler was not using `sink`.
|
* Bug fix: fixed regression where MockHandler was not using `sink`.
|
||||||
https://github.com/guzzle/guzzle/pull/1292
|
https://github.com/guzzle/guzzle/pull/1292
|
||||||
|
|
||||||
|
|
||||||
## 6.1.0 - 2015-09-08
|
## 6.1.0 - 2015-09-08
|
||||||
|
|
||||||
* Feature: Added the `on_stats` request option to provide access to transfer
|
* Feature: Added the `on_stats` request option to provide access to transfer
|
||||||
@@ -360,6 +445,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set.
|
* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set.
|
||||||
https://github.com/guzzle/guzzle/pull/1189
|
https://github.com/guzzle/guzzle/pull/1189
|
||||||
|
|
||||||
|
|
||||||
## 6.0.2 - 2015-07-04
|
## 6.0.2 - 2015-07-04
|
||||||
|
|
||||||
* Fixed a memory leak in the curl handlers in which references to callbacks
|
* Fixed a memory leak in the curl handlers in which references to callbacks
|
||||||
@@ -377,6 +463,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Functions are now conditionally required using an additional level of
|
* Functions are now conditionally required using an additional level of
|
||||||
indirection to help with global Composer installations.
|
indirection to help with global Composer installations.
|
||||||
|
|
||||||
|
|
||||||
## 6.0.1 - 2015-05-27
|
## 6.0.1 - 2015-05-27
|
||||||
|
|
||||||
* Fixed a bug with serializing the `query` request option where the `&`
|
* Fixed a bug with serializing the `query` request option where the `&`
|
||||||
@@ -385,6 +472,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
use `form_params` or `multipart` instead.
|
use `form_params` or `multipart` instead.
|
||||||
* Various doc fixes.
|
* Various doc fixes.
|
||||||
|
|
||||||
|
|
||||||
## 6.0.0 - 2015-05-26
|
## 6.0.0 - 2015-05-26
|
||||||
|
|
||||||
* See the UPGRADING.md document for more information.
|
* See the UPGRADING.md document for more information.
|
||||||
@@ -409,6 +497,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* `$maxHandles` has been removed from CurlMultiHandler.
|
* `$maxHandles` has been removed from CurlMultiHandler.
|
||||||
* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package.
|
* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package.
|
||||||
|
|
||||||
|
|
||||||
## 5.3.0 - 2015-05-19
|
## 5.3.0 - 2015-05-19
|
||||||
|
|
||||||
* Mock now supports `save_to`
|
* Mock now supports `save_to`
|
||||||
@@ -419,6 +508,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated.
|
* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated.
|
||||||
* URL scheme is now always lowercased.
|
* URL scheme is now always lowercased.
|
||||||
|
|
||||||
|
|
||||||
## 6.0.0-beta.1
|
## 6.0.0-beta.1
|
||||||
|
|
||||||
* Requires PHP >= 5.5
|
* Requires PHP >= 5.5
|
||||||
@@ -471,6 +561,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* `GuzzleHttp\QueryParser` has been replaced with the
|
* `GuzzleHttp\QueryParser` has been replaced with the
|
||||||
`GuzzleHttp\Psr7\parse_query`.
|
`GuzzleHttp\Psr7\parse_query`.
|
||||||
|
|
||||||
|
|
||||||
## 5.2.0 - 2015-01-27
|
## 5.2.0 - 2015-01-27
|
||||||
|
|
||||||
* Added `AppliesHeadersInterface` to make applying headers to a request based
|
* Added `AppliesHeadersInterface` to make applying headers to a request based
|
||||||
@@ -481,6 +572,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
RingBridge.
|
RingBridge.
|
||||||
* Added a guard in the Pool class to not use recursion for request retries.
|
* Added a guard in the Pool class to not use recursion for request retries.
|
||||||
|
|
||||||
|
|
||||||
## 5.1.0 - 2014-12-19
|
## 5.1.0 - 2014-12-19
|
||||||
|
|
||||||
* Pool class no longer uses recursion when a request is intercepted.
|
* Pool class no longer uses recursion when a request is intercepted.
|
||||||
@@ -501,6 +593,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
|
|||||||
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
|
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
|
||||||
specific exceptions if necessary.
|
specific exceptions if necessary.
|
||||||
|
|
||||||
|
|
||||||
## 5.0.3 - 2014-11-03
|
## 5.0.3 - 2014-11-03
|
||||||
|
|
||||||
This change updates query strings so that they are treated as un-encoded values
|
This change updates query strings so that they are treated as un-encoded values
|
||||||
@@ -515,6 +608,7 @@ string that should not be parsed or encoded (unless a call to getQuery() is
|
|||||||
subsequently made, forcing the query-string to be converted into a Query
|
subsequently made, forcing the query-string to be converted into a Query
|
||||||
object).
|
object).
|
||||||
|
|
||||||
|
|
||||||
## 5.0.2 - 2014-10-30
|
## 5.0.2 - 2014-10-30
|
||||||
|
|
||||||
* Added a trailing `\r\n` to multipart/form-data payloads. See
|
* Added a trailing `\r\n` to multipart/form-data payloads. See
|
||||||
@@ -536,6 +630,7 @@ object).
|
|||||||
string on a URL: Now allowing many more characters to be present in the
|
string on a URL: Now allowing many more characters to be present in the
|
||||||
query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
|
query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
|
||||||
|
|
||||||
|
|
||||||
## 5.0.1 - 2014-10-16
|
## 5.0.1 - 2014-10-16
|
||||||
|
|
||||||
Bugfix release.
|
Bugfix release.
|
||||||
@@ -547,6 +642,7 @@ Bugfix release.
|
|||||||
* Fixed an issue where transfer statistics were not being populated in the
|
* Fixed an issue where transfer statistics were not being populated in the
|
||||||
RingBridge. https://github.com/guzzle/guzzle/issues/866
|
RingBridge. https://github.com/guzzle/guzzle/issues/866
|
||||||
|
|
||||||
|
|
||||||
## 5.0.0 - 2014-10-12
|
## 5.0.0 - 2014-10-12
|
||||||
|
|
||||||
Adding support for non-blocking responses and some minor API cleanup.
|
Adding support for non-blocking responses and some minor API cleanup.
|
||||||
@@ -628,6 +724,7 @@ interfaces.
|
|||||||
argument. They now accept an associative array of options, including the
|
argument. They now accept an associative array of options, including the
|
||||||
"size" key and "metadata" key which can be used to provide custom metadata.
|
"size" key and "metadata" key which can be used to provide custom metadata.
|
||||||
|
|
||||||
|
|
||||||
## 4.2.2 - 2014-09-08
|
## 4.2.2 - 2014-09-08
|
||||||
|
|
||||||
* Fixed a memory leak in the CurlAdapter when reusing cURL handles.
|
* Fixed a memory leak in the CurlAdapter when reusing cURL handles.
|
||||||
|
|||||||
@@ -60,13 +60,13 @@ composer require guzzlehttp/guzzle
|
|||||||
|
|
||||||
## Version Guidance
|
## Version Guidance
|
||||||
|
|
||||||
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|
||||||
|---------|----------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
|
|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
|
||||||
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
|
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
|
||||||
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
|
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
|
||||||
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
|
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
|
||||||
| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
|
| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
|
||||||
| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.2 |
|
| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 |
|
||||||
|
|
||||||
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
|
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
|
||||||
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
|
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
|
||||||
|
|||||||
@@ -53,8 +53,8 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"guzzlehttp/promises": "^1.5",
|
"guzzlehttp/promises": "^1.5.3 || ^2.0",
|
||||||
"guzzlehttp/psr7": "^1.9 || ^2.4",
|
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
|
||||||
"psr/http-client": "^1.0",
|
"psr/http-client": "^1.0",
|
||||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||||
},
|
},
|
||||||
@@ -63,9 +63,10 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"php-http/client-integration-tests": "^3.0",
|
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
|
||||||
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
|
"php-http/message-factory": "^1.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
|
||||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@@ -81,8 +82,9 @@
|
|||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "7.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
@@ -120,13 +120,14 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
public function send(RequestInterface $request, array $options = []): ResponseInterface
|
public function send(RequestInterface $request, array $options = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$options[RequestOptions::SYNCHRONOUS] = true;
|
$options[RequestOptions::SYNCHRONOUS] = true;
|
||||||
|
|
||||||
return $this->sendAsync($request, $options)->wait();
|
return $this->sendAsync($request, $options)->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The HttpClient PSR (PSR-18) specify this method.
|
* The HttpClient PSR (PSR-18) specify this method.
|
||||||
*
|
*
|
||||||
* @inheritDoc
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public function sendRequest(RequestInterface $request): ResponseInterface
|
public function sendRequest(RequestInterface $request): ResponseInterface
|
||||||
{
|
{
|
||||||
@@ -184,6 +185,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
public function request(string $method, $uri = '', array $options = []): ResponseInterface
|
public function request(string $method, $uri = '', array $options = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$options[RequestOptions::SYNCHRONOUS] = true;
|
$options[RequestOptions::SYNCHRONOUS] = true;
|
||||||
|
|
||||||
return $this->requestAsync($method, $uri, $options)->wait();
|
return $this->requestAsync($method, $uri, $options)->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,11 +230,11 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
{
|
{
|
||||||
$defaults = [
|
$defaults = [
|
||||||
'allow_redirects' => RedirectMiddleware::$defaultSettings,
|
'allow_redirects' => RedirectMiddleware::$defaultSettings,
|
||||||
'http_errors' => true,
|
'http_errors' => true,
|
||||||
'decode_content' => true,
|
'decode_content' => true,
|
||||||
'verify' => true,
|
'verify' => true,
|
||||||
'cookies' => false,
|
'cookies' => false,
|
||||||
'idn_conversion' => false,
|
'idn_conversion' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
|
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
|
||||||
@@ -354,10 +356,10 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
if (isset($options['form_params'])) {
|
if (isset($options['form_params'])) {
|
||||||
if (isset($options['multipart'])) {
|
if (isset($options['multipart'])) {
|
||||||
throw new InvalidArgumentException('You cannot use '
|
throw new InvalidArgumentException('You cannot use '
|
||||||
. 'form_params and multipart at the same time. Use the '
|
.'form_params and multipart at the same time. Use the '
|
||||||
. 'form_params option if you want to send application/'
|
.'form_params option if you want to send application/'
|
||||||
. 'x-www-form-urlencoded requests, and the multipart '
|
.'x-www-form-urlencoded requests, and the multipart '
|
||||||
. 'option to send multipart/form-data requests.');
|
.'option to send multipart/form-data requests.');
|
||||||
}
|
}
|
||||||
$options['body'] = \http_build_query($options['form_params'], '', '&');
|
$options['body'] = \http_build_query($options['form_params'], '', '&');
|
||||||
unset($options['form_params']);
|
unset($options['form_params']);
|
||||||
@@ -403,7 +405,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
// Ensure that we don't have the header in different case and set the new value.
|
// Ensure that we don't have the header in different case and set the new value.
|
||||||
$modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
|
$modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
|
||||||
$modify['set_headers']['Authorization'] = 'Basic '
|
$modify['set_headers']['Authorization'] = 'Basic '
|
||||||
. \base64_encode("$value[0]:$value[1]");
|
.\base64_encode("$value[0]:$value[1]");
|
||||||
break;
|
break;
|
||||||
case 'digest':
|
case 'digest':
|
||||||
// @todo: Do not rely on curl
|
// @todo: Do not rely on curl
|
||||||
@@ -437,13 +439,17 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($options['version'])) {
|
||||||
|
$modify['version'] = $options['version'];
|
||||||
|
}
|
||||||
|
|
||||||
$request = Psr7\Utils::modifyRequest($request, $modify);
|
$request = Psr7\Utils::modifyRequest($request, $modify);
|
||||||
if ($request->getBody() instanceof Psr7\MultipartStream) {
|
if ($request->getBody() instanceof Psr7\MultipartStream) {
|
||||||
// Use a multipart/form-data POST if a Content-Type is not set.
|
// Use a multipart/form-data POST if a Content-Type is not set.
|
||||||
// Ensure that we don't have the header in different case and set the new value.
|
// Ensure that we don't have the header in different case and set the new value.
|
||||||
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
|
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
|
||||||
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
|
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
|
||||||
. $request->getBody()->getBoundary();
|
.$request->getBody()->getBoundary();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge in conditional headers if they are not present.
|
// Merge in conditional headers if they are not present.
|
||||||
@@ -469,9 +475,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
|
|||||||
private function invalidBody(): InvalidArgumentException
|
private function invalidBody(): InvalidArgumentException
|
||||||
{
|
{
|
||||||
return new InvalidArgumentException('Passing in the "body" request '
|
return new InvalidArgumentException('Passing in the "body" request '
|
||||||
. 'option as an array to send a request is not supported. '
|
.'option as an array to send a request is not supported. '
|
||||||
. 'Please use the "form_params" request option to send a '
|
.'Please use the "form_params" request option to send a '
|
||||||
. 'application/x-www-form-urlencoded request, or the "multipart" '
|
.'application/x-www-form-urlencoded request, or the "multipart" '
|
||||||
. 'request option to send a multipart/form-data request.');
|
.'request option to send a multipart/form-data request.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ class CookieJar implements CookieJarInterface
|
|||||||
$cookieJar = new self();
|
$cookieJar = new self();
|
||||||
foreach ($cookies as $name => $value) {
|
foreach ($cookies as $name => $value) {
|
||||||
$cookieJar->setCookie(new SetCookie([
|
$cookieJar->setCookie(new SetCookie([
|
||||||
'Domain' => $domain,
|
'Domain' => $domain,
|
||||||
'Name' => $name,
|
'Name' => $name,
|
||||||
'Value' => $value,
|
'Value' => $value,
|
||||||
'Discard' => true
|
'Discard' => true,
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ class CookieJar implements CookieJarInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
@@ -107,12 +107,13 @@ class CookieJar implements CookieJarInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
|
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
|
||||||
{
|
{
|
||||||
if (!$domain) {
|
if (!$domain) {
|
||||||
$this->cookies = [];
|
$this->cookies = [];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} elseif (!$path) {
|
} elseif (!$path) {
|
||||||
$this->cookies = \array_filter(
|
$this->cookies = \array_filter(
|
||||||
@@ -142,7 +143,7 @@ class CookieJar implements CookieJarInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public function clearSessionCookies(): void
|
public function clearSessionCookies(): void
|
||||||
{
|
{
|
||||||
@@ -155,7 +156,7 @@ class CookieJar implements CookieJarInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public function setCookie(SetCookie $cookie): bool
|
public function setCookie(SetCookie $cookie): bool
|
||||||
{
|
{
|
||||||
@@ -170,15 +171,15 @@ class CookieJar implements CookieJarInterface
|
|||||||
$result = $cookie->validate();
|
$result = $cookie->validate();
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
if ($this->strictMode) {
|
if ($this->strictMode) {
|
||||||
throw new \RuntimeException('Invalid cookie: ' . $result);
|
throw new \RuntimeException('Invalid cookie: '.$result);
|
||||||
}
|
}
|
||||||
$this->removeCookieIfEmpty($cookie);
|
$this->removeCookieIfEmpty($cookie);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve conflicts with previously set cookies
|
// Resolve conflicts with previously set cookies
|
||||||
foreach ($this->cookies as $i => $c) {
|
foreach ($this->cookies as $i => $c) {
|
||||||
|
|
||||||
// Two cookies are identical, when their path, and domain are
|
// Two cookies are identical, when their path, and domain are
|
||||||
// identical.
|
// identical.
|
||||||
if ($c->getPath() != $cookie->getPath() ||
|
if ($c->getPath() != $cookie->getPath() ||
|
||||||
@@ -254,7 +255,7 @@ class CookieJar implements CookieJarInterface
|
|||||||
/**
|
/**
|
||||||
* Computes cookie path following RFC 6265 section 5.1.4
|
* Computes cookie path following RFC 6265 section 5.1.4
|
||||||
*
|
*
|
||||||
* @link https://tools.ietf.org/html/rfc6265#section-5.1.4
|
* @see https://tools.ietf.org/html/rfc6265#section-5.1.4
|
||||||
*/
|
*/
|
||||||
private function getCookiePathFromRequest(RequestInterface $request): string
|
private function getCookiePathFromRequest(RequestInterface $request): string
|
||||||
{
|
{
|
||||||
@@ -290,8 +291,8 @@ class CookieJar implements CookieJarInterface
|
|||||||
!$cookie->isExpired() &&
|
!$cookie->isExpired() &&
|
||||||
(!$cookie->getSecure() || $scheme === 'https')
|
(!$cookie->getSecure() || $scheme === 'https')
|
||||||
) {
|
) {
|
||||||
$values[] = $cookie->getName() . '='
|
$values[] = $cookie->getName().'='
|
||||||
. $cookie->getValue();
|
.$cookie->getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
* necessary. Subclasses are also responsible for storing and retrieving
|
* necessary. Subclasses are also responsible for storing and retrieving
|
||||||
* cookies from a file, database, etc.
|
* cookies from a file, database, etc.
|
||||||
*
|
*
|
||||||
* @link https://docs.python.org/2/library/cookielib.html Inspiration
|
* @see https://docs.python.org/2/library/cookielib.html Inspiration
|
||||||
* @extends \IteratorAggregate<SetCookie>
|
* @extends \IteratorAggregate<SetCookie>
|
||||||
*/
|
*/
|
||||||
interface CookieJarInterface extends \Countable, \IteratorAggregate
|
interface CookieJarInterface extends \Countable, \IteratorAggregate
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class SessionCookieJar extends CookieJar
|
|||||||
$this->setCookie(new SetCookie($cookie));
|
$this->setCookie(new SetCookie($cookie));
|
||||||
}
|
}
|
||||||
} elseif (\strlen($data)) {
|
} elseif (\strlen($data)) {
|
||||||
throw new \RuntimeException("Invalid cookie data");
|
throw new \RuntimeException('Invalid cookie data');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ class SetCookie
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private static $defaults = [
|
private static $defaults = [
|
||||||
'Name' => null,
|
'Name' => null,
|
||||||
'Value' => null,
|
'Value' => null,
|
||||||
'Domain' => null,
|
'Domain' => null,
|
||||||
'Path' => '/',
|
'Path' => '/',
|
||||||
'Max-Age' => null,
|
'Max-Age' => null,
|
||||||
'Expires' => null,
|
'Expires' => null,
|
||||||
'Secure' => false,
|
'Secure' => false,
|
||||||
'Discard' => false,
|
'Discard' => false,
|
||||||
'HttpOnly' => false
|
'HttpOnly' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +58,13 @@ class SetCookie
|
|||||||
} else {
|
} else {
|
||||||
foreach (\array_keys(self::$defaults) as $search) {
|
foreach (\array_keys(self::$defaults) as $search) {
|
||||||
if (!\strcasecmp($search, $key)) {
|
if (!\strcasecmp($search, $key)) {
|
||||||
$data[$search] = $value;
|
if ($search === 'Max-Age') {
|
||||||
|
if (is_numeric($value)) {
|
||||||
|
$data[$search] = (int) $value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$data[$search] = $value;
|
||||||
|
}
|
||||||
continue 2;
|
continue 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,13 +80,49 @@ class SetCookie
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = [])
|
public function __construct(array $data = [])
|
||||||
{
|
{
|
||||||
/** @var array|null $replaced will be null in case of replace error */
|
$this->data = self::$defaults;
|
||||||
$replaced = \array_replace(self::$defaults, $data);
|
|
||||||
if ($replaced === null) {
|
if (isset($data['Name'])) {
|
||||||
throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
|
$this->setName($data['Name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Value'])) {
|
||||||
|
$this->setValue($data['Value']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Domain'])) {
|
||||||
|
$this->setDomain($data['Domain']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Path'])) {
|
||||||
|
$this->setPath($data['Path']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Max-Age'])) {
|
||||||
|
$this->setMaxAge($data['Max-Age']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Expires'])) {
|
||||||
|
$this->setExpires($data['Expires']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Secure'])) {
|
||||||
|
$this->setSecure($data['Secure']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['Discard'])) {
|
||||||
|
$this->setDiscard($data['Discard']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['HttpOnly'])) {
|
||||||
|
$this->setHttpOnly($data['HttpOnly']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the remaining values that don't have extra validation logic
|
||||||
|
foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) {
|
||||||
|
$this->data[$key] = $data[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data = $replaced;
|
|
||||||
// Extract the Expires value and turn it into a UNIX timestamp if needed
|
// Extract the Expires value and turn it into a UNIX timestamp if needed
|
||||||
if (!$this->getExpires() && $this->getMaxAge()) {
|
if (!$this->getExpires() && $this->getMaxAge()) {
|
||||||
// Calculate the Expires date
|
// Calculate the Expires date
|
||||||
@@ -92,13 +134,13 @@ class SetCookie
|
|||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
$str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; ';
|
$str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; ';
|
||||||
foreach ($this->data as $k => $v) {
|
foreach ($this->data as $k => $v) {
|
||||||
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
|
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
|
||||||
if ($k === 'Expires') {
|
if ($k === 'Expires') {
|
||||||
$str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
|
$str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; ';
|
||||||
} else {
|
} else {
|
||||||
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
|
$str .= ($v === true ? $k : "{$k}={$v}").'; ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,7 +436,7 @@ class SetCookie
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
|
return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -423,8 +465,8 @@ class SetCookie
|
|||||||
$name
|
$name
|
||||||
)) {
|
)) {
|
||||||
return 'Cookie name must not contain invalid characters: ASCII '
|
return 'Cookie name must not contain invalid characters: ASCII '
|
||||||
. 'Control characters (0-31;127), space, tab and the '
|
.'Control characters (0-31;127), space, tab and the '
|
||||||
. 'following characters: ()<>@,;:\"/?={}';
|
.'following characters: ()<>@,;:\"/?={}';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Value must not be null. 0 and empty string are valid. Empty strings
|
// Value must not be null. 0 and empty string are valid. Empty strings
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
unset($options['curl']['body_as_string']);
|
unset($options['curl']['body_as_string']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$easy = new EasyHandle;
|
$easy = new EasyHandle();
|
||||||
$easy->request = $request;
|
$easy->request = $request;
|
||||||
$easy->options = $options;
|
$easy->options = $options;
|
||||||
$conf = $this->getDefaultConf($easy);
|
$conf = $this->getDefaultConf($easy);
|
||||||
@@ -161,11 +161,11 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
|
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
|
||||||
{
|
{
|
||||||
static $connectionErrors = [
|
static $connectionErrors = [
|
||||||
\CURLE_OPERATION_TIMEOUTED => true,
|
\CURLE_OPERATION_TIMEOUTED => true,
|
||||||
\CURLE_COULDNT_RESOLVE_HOST => true,
|
\CURLE_COULDNT_RESOLVE_HOST => true,
|
||||||
\CURLE_COULDNT_CONNECT => true,
|
\CURLE_COULDNT_CONNECT => true,
|
||||||
\CURLE_SSL_CONNECT_ERROR => true,
|
\CURLE_SSL_CONNECT_ERROR => true,
|
||||||
\CURLE_GOT_NOTHING => true,
|
\CURLE_GOT_NOTHING => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($easy->createResponseException) {
|
if ($easy->createResponseException) {
|
||||||
@@ -219,12 +219,12 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
private function getDefaultConf(EasyHandle $easy): array
|
private function getDefaultConf(EasyHandle $easy): array
|
||||||
{
|
{
|
||||||
$conf = [
|
$conf = [
|
||||||
'_headers' => $easy->request->getHeaders(),
|
'_headers' => $easy->request->getHeaders(),
|
||||||
\CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
|
\CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
|
||||||
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
|
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
|
||||||
\CURLOPT_RETURNTRANSFER => false,
|
\CURLOPT_RETURNTRANSFER => false,
|
||||||
\CURLOPT_HEADER => false,
|
\CURLOPT_HEADER => false,
|
||||||
\CURLOPT_CONNECTTIMEOUT => 150,
|
\CURLOPT_CONNECTTIMEOUT => 300,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (\defined('CURLOPT_PROTOCOLS')) {
|
if (\defined('CURLOPT_PROTOCOLS')) {
|
||||||
@@ -250,6 +250,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
|
|
||||||
if ($size === null || $size > 0) {
|
if ($size === null || $size > 0) {
|
||||||
$this->applyBody($easy->request, $easy->options, $conf);
|
$this->applyBody($easy->request, $easy->options, $conf);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,6 +342,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
foreach (\array_keys($options['_headers']) as $key) {
|
foreach (\array_keys($options['_headers']) as $key) {
|
||||||
if (!\strcasecmp($key, $name)) {
|
if (!\strcasecmp($key, $name)) {
|
||||||
unset($options['_headers'][$key]);
|
unset($options['_headers'][$key]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -443,13 +445,41 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
$scheme = $easy->request->getUri()->getScheme();
|
$scheme = $easy->request->getUri()->getScheme();
|
||||||
if (isset($options['proxy'][$scheme])) {
|
if (isset($options['proxy'][$scheme])) {
|
||||||
$host = $easy->request->getUri()->getHost();
|
$host = $easy->request->getUri()->getHost();
|
||||||
if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
|
if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
|
||||||
|
unset($conf[\CURLOPT_PROXY]);
|
||||||
|
} else {
|
||||||
$conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
|
$conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($options['crypto_method'])) {
|
||||||
|
if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
|
||||||
|
if (!defined('CURL_SSLVERSION_TLSv1_0')) {
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
|
||||||
|
}
|
||||||
|
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
|
||||||
|
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
|
||||||
|
if (!defined('CURL_SSLVERSION_TLSv1_1')) {
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
|
||||||
|
}
|
||||||
|
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
|
||||||
|
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
|
||||||
|
if (!defined('CURL_SSLVERSION_TLSv1_2')) {
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
|
||||||
|
}
|
||||||
|
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
|
||||||
|
} elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
|
||||||
|
if (!defined('CURL_SSLVERSION_TLSv1_3')) {
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
|
||||||
|
}
|
||||||
|
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
|
||||||
|
} else {
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($options['cert'])) {
|
if (isset($options['cert'])) {
|
||||||
$cert = $options['cert'];
|
$cert = $options['cert'];
|
||||||
if (\is_array($cert)) {
|
if (\is_array($cert)) {
|
||||||
@@ -459,8 +489,8 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
if (!\file_exists($cert)) {
|
if (!\file_exists($cert)) {
|
||||||
throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
|
throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
|
||||||
}
|
}
|
||||||
# OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
|
// OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
|
||||||
# see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
|
// see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
|
||||||
$ext = pathinfo($cert, \PATHINFO_EXTENSION);
|
$ext = pathinfo($cert, \PATHINFO_EXTENSION);
|
||||||
if (preg_match('#^(der|p12)$#i', $ext)) {
|
if (preg_match('#^(der|p12)$#i', $ext)) {
|
||||||
$conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
|
$conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
|
||||||
@@ -523,9 +553,10 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
}
|
}
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
$ctx['error'] = 'The connection unexpectedly failed without '
|
$ctx['error'] = 'The connection unexpectedly failed without '
|
||||||
. 'providing an error. The request would have been retried, '
|
.'providing an error. The request would have been retried, '
|
||||||
. 'but attempting to rewind the request body failed. '
|
.'but attempting to rewind the request body failed. '
|
||||||
. 'Exception: ' . $e;
|
.'Exception: '.$e;
|
||||||
|
|
||||||
return self::createRejection($easy, $ctx);
|
return self::createRejection($easy, $ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,14 +565,15 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
$easy->options['_curl_retries'] = 1;
|
$easy->options['_curl_retries'] = 1;
|
||||||
} elseif ($easy->options['_curl_retries'] == 2) {
|
} elseif ($easy->options['_curl_retries'] == 2) {
|
||||||
$ctx['error'] = 'The cURL request was retried 3 times '
|
$ctx['error'] = 'The cURL request was retried 3 times '
|
||||||
. 'and did not succeed. The most likely reason for the failure '
|
.'and did not succeed. The most likely reason for the failure '
|
||||||
. 'is that cURL was unable to rewind the body of the request '
|
.'is that cURL was unable to rewind the body of the request '
|
||||||
. 'and subsequent retries resulted in the same error. Turn on '
|
.'and subsequent retries resulted in the same error. Turn on '
|
||||||
. 'the debug option to see what went wrong. See '
|
.'the debug option to see what went wrong. See '
|
||||||
. 'https://bugs.php.net/bug.php?id=47204 for more information.';
|
.'https://bugs.php.net/bug.php?id=47204 for more information.';
|
||||||
|
|
||||||
return self::createRejection($easy, $ctx);
|
return self::createRejection($easy, $ctx);
|
||||||
} else {
|
} else {
|
||||||
$easy->options['_curl_retries']++;
|
++$easy->options['_curl_retries'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $handler($easy->request, $easy->options);
|
return $handler($easy->request, $easy->options);
|
||||||
@@ -571,6 +603,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
$easy->createResponse();
|
$easy->createResponse();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$easy->createResponseException = $e;
|
$easy->createResponseException = $e;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ($onHeaders !== null) {
|
if ($onHeaders !== null) {
|
||||||
@@ -580,6 +613,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
// Associate the exception with the handle and trigger
|
// Associate the exception with the handle and trigger
|
||||||
// a curl header write error by returning 0.
|
// a curl header write error by returning 0.
|
||||||
$easy->onHeadersException = $e;
|
$easy->onHeadersException = $e;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -589,6 +623,7 @@ class CurlFactory implements CurlFactoryInterface
|
|||||||
} else {
|
} else {
|
||||||
$easy->headers[] = $value;
|
$easy->headers[] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return \strlen($h);
|
return \strlen($h);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use Psr\Http\Message\RequestInterface;
|
|||||||
*
|
*
|
||||||
* @final
|
* @final
|
||||||
*/
|
*/
|
||||||
|
#[\AllowDynamicProperties]
|
||||||
class CurlMultiHandler
|
class CurlMultiHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +164,8 @@ class CurlMultiHandler
|
|||||||
\usleep(250);
|
\usleep(250);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
|
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
|
||||||
|
}
|
||||||
|
|
||||||
$this->processMessages();
|
$this->processMessages();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ final class EasyHandle
|
|||||||
*/
|
*/
|
||||||
public function __get($name)
|
public function __get($name)
|
||||||
{
|
{
|
||||||
$msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
|
$msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name;
|
||||||
throw new \BadMethodCallException($msg);
|
throw new \BadMethodCallException($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ final class HeaderProcessor
|
|||||||
*
|
*
|
||||||
* @param string[] $headers
|
* @param string[] $headers
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException
|
|
||||||
*
|
|
||||||
* @return array{0:string, 1:int, 2:?string, 3:array}
|
* @return array{0:string, 1:int, 2:?string, 3:array}
|
||||||
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public static function parseHeaders(array $headers): array
|
public static function parseHeaders(array $headers): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class MockHandler implements \Countable
|
|||||||
if ($this->onRejected) {
|
if ($this->onRejected) {
|
||||||
($this->onRejected)($reason);
|
($this->onRejected)($reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
return P\Create::rejectionFor($reason);
|
return P\Create::rejectionFor($reason);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -159,7 +160,7 @@ class MockHandler implements \Countable
|
|||||||
) {
|
) {
|
||||||
$this->queue[] = $value;
|
$this->queue[] = $value;
|
||||||
} else {
|
} else {
|
||||||
throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
|
throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class StreamHandler
|
|||||||
if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
|
if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
|
||||||
|| false !== \strpos($message, 'Connection refused')
|
|| false !== \strpos($message, 'Connection refused')
|
||||||
|| false !== \strpos($message, "couldn't connect to host") // error on HHVM
|
|| false !== \strpos($message, "couldn't connect to host") // error on HHVM
|
||||||
|| false !== \strpos($message, "connection attempt failed")
|
|| false !== \strpos($message, 'connection attempt failed')
|
||||||
) {
|
) {
|
||||||
$e = new ConnectException($e->getMessage(), $request, $e);
|
$e = new ConnectException($e->getMessage(), $request, $e);
|
||||||
} else {
|
} else {
|
||||||
@@ -231,9 +231,10 @@ class StreamHandler
|
|||||||
\set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
|
\set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
|
||||||
$errors[] = [
|
$errors[] = [
|
||||||
'message' => $msg,
|
'message' => $msg,
|
||||||
'file' => $file,
|
'file' => $file,
|
||||||
'line' => $line
|
'line' => $line,
|
||||||
];
|
];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -247,7 +248,7 @@ class StreamHandler
|
|||||||
$message = 'Error creating resource: ';
|
$message = 'Error creating resource: ';
|
||||||
foreach ($errors as $err) {
|
foreach ($errors as $err) {
|
||||||
foreach ($err as $key => $value) {
|
foreach ($err as $key => $value) {
|
||||||
$message .= "[$key] $value" . \PHP_EOL;
|
$message .= "[$key] $value".\PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \RuntimeException(\trim($message));
|
throw new \RuntimeException(\trim($message));
|
||||||
@@ -350,6 +351,7 @@ class StreamHandler
|
|||||||
if (false === $records || !isset($records[0]['ip'])) {
|
if (false === $records || !isset($records[0]['ip'])) {
|
||||||
throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
|
throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $uri->withHost($records[0]['ip']);
|
return $uri->withHost($records[0]['ip']);
|
||||||
}
|
}
|
||||||
if ('v6' === $options['force_ip_resolve']) {
|
if ('v6' === $options['force_ip_resolve']) {
|
||||||
@@ -357,7 +359,8 @@ class StreamHandler
|
|||||||
if (false === $records || !isset($records[0]['ipv6'])) {
|
if (false === $records || !isset($records[0]['ipv6'])) {
|
||||||
throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
|
throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
|
||||||
}
|
}
|
||||||
return $uri->withHost('[' . $records[0]['ipv6'] . ']');
|
|
||||||
|
return $uri->withHost('['.$records[0]['ipv6'].']');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,11 +378,11 @@ class StreamHandler
|
|||||||
|
|
||||||
$context = [
|
$context = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method' => $request->getMethod(),
|
'method' => $request->getMethod(),
|
||||||
'header' => $headers,
|
'header' => $headers,
|
||||||
'protocol_version' => $request->getProtocolVersion(),
|
'protocol_version' => $request->getProtocolVersion(),
|
||||||
'ignore_errors' => true,
|
'ignore_errors' => true,
|
||||||
'follow_location' => 0,
|
'follow_location' => 0,
|
||||||
],
|
],
|
||||||
'ssl' => [
|
'ssl' => [
|
||||||
'peer_name' => $request->getUri()->getHost(),
|
'peer_name' => $request->getUri()->getHost(),
|
||||||
@@ -388,7 +391,7 @@ class StreamHandler
|
|||||||
|
|
||||||
$body = (string) $request->getBody();
|
$body = (string) $request->getBody();
|
||||||
|
|
||||||
if (!empty($body)) {
|
if ('' !== $body) {
|
||||||
$context['http']['content'] = $body;
|
$context['http']['content'] = $body;
|
||||||
// Prevent the HTTP handler from adding a Content-Type header.
|
// Prevent the HTTP handler from adding a Content-Type header.
|
||||||
if (!$request->hasHeader('Content-Type')) {
|
if (!$request->hasHeader('Content-Type')) {
|
||||||
@@ -472,6 +475,25 @@ class StreamHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $value as passed via Request transfer options.
|
||||||
|
*/
|
||||||
|
private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
$value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
|
||||||
|
|| $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
|
||||||
|
|| $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
|
||||||
|
|| (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT)
|
||||||
|
) {
|
||||||
|
$options['http']['crypto_method'] = $value;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $value as passed via Request transfer options.
|
* @param mixed $value as passed via Request transfer options.
|
||||||
*/
|
*/
|
||||||
@@ -542,27 +564,27 @@ class StreamHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
static $map = [
|
static $map = [
|
||||||
\STREAM_NOTIFY_CONNECT => 'CONNECT',
|
\STREAM_NOTIFY_CONNECT => 'CONNECT',
|
||||||
\STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
|
\STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
|
||||||
\STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
|
\STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
|
||||||
\STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
|
\STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
|
||||||
\STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
|
\STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
|
||||||
\STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
|
\STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
|
||||||
\STREAM_NOTIFY_PROGRESS => 'PROGRESS',
|
\STREAM_NOTIFY_PROGRESS => 'PROGRESS',
|
||||||
\STREAM_NOTIFY_FAILURE => 'FAILURE',
|
\STREAM_NOTIFY_FAILURE => 'FAILURE',
|
||||||
\STREAM_NOTIFY_COMPLETED => 'COMPLETED',
|
\STREAM_NOTIFY_COMPLETED => 'COMPLETED',
|
||||||
\STREAM_NOTIFY_RESOLVE => 'RESOLVE',
|
\STREAM_NOTIFY_RESOLVE => 'RESOLVE',
|
||||||
];
|
];
|
||||||
static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
|
static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
|
||||||
|
|
||||||
$value = Utils::debugResource($value);
|
$value = Utils::debugResource($value);
|
||||||
$ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
|
$ident = $request->getMethod().' '.$request->getUri()->withFragment('');
|
||||||
self::addNotification(
|
self::addNotification(
|
||||||
$params,
|
$params,
|
||||||
static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
|
static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
|
||||||
\fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
|
\fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
|
||||||
foreach (\array_filter($passed) as $i => $v) {
|
foreach (\array_filter($passed) as $i => $v) {
|
||||||
\fwrite($value, $args[$i] . ': "' . $v . '" ');
|
\fwrite($value, $args[$i].': "'.$v.'" ');
|
||||||
}
|
}
|
||||||
\fwrite($value, "\n");
|
\fwrite($value, "\n");
|
||||||
}
|
}
|
||||||
@@ -577,7 +599,7 @@ class StreamHandler
|
|||||||
} else {
|
} else {
|
||||||
$params['notification'] = self::callArray([
|
$params['notification'] = self::callArray([
|
||||||
$params['notification'],
|
$params['notification'],
|
||||||
$notify
|
$notify,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,14 +86,14 @@ class HandlerStack
|
|||||||
$stack = [];
|
$stack = [];
|
||||||
|
|
||||||
if ($this->handler !== null) {
|
if ($this->handler !== null) {
|
||||||
$stack[] = "0) Handler: " . $this->debugCallable($this->handler);
|
$stack[] = '0) Handler: '.$this->debugCallable($this->handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach (\array_reverse($this->stack) as $tuple) {
|
foreach (\array_reverse($this->stack) as $tuple) {
|
||||||
$depth++;
|
++$depth;
|
||||||
$str = "{$depth}) Name: '{$tuple[1]}', ";
|
$str = "{$depth}) Name: '{$tuple[1]}', ";
|
||||||
$str .= "Function: " . $this->debugCallable($tuple[0]);
|
$str .= 'Function: '.$this->debugCallable($tuple[0]);
|
||||||
$result = "> {$str}\n{$result}";
|
$result = "> {$str}\n{$result}";
|
||||||
$stack[] = $str;
|
$stack[] = $str;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ class HandlerStack
|
|||||||
*/
|
*/
|
||||||
public function hasHandler(): bool
|
public function hasHandler(): bool
|
||||||
{
|
{
|
||||||
return $this->handler !== null ;
|
return $this->handler !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -266,10 +266,10 @@ class HandlerStack
|
|||||||
if (\is_array($fn)) {
|
if (\is_array($fn)) {
|
||||||
return \is_string($fn[0])
|
return \is_string($fn[0])
|
||||||
? "callable({$fn[0]}::{$fn[1]})"
|
? "callable({$fn[0]}::{$fn[1]})"
|
||||||
: "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
|
: "callable(['".\get_class($fn[0])."', '{$fn[1]}'])";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var object $fn */
|
/** @var object $fn */
|
||||||
return 'callable(' . \spl_object_hash($fn) . ')';
|
return 'callable('.\spl_object_hash($fn).')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ class MessageFormatter implements MessageFormatterInterface
|
|||||||
/**
|
/**
|
||||||
* Apache Common Log Format.
|
* Apache Common Log Format.
|
||||||
*
|
*
|
||||||
* @link https://httpd.apache.org/docs/2.4/logs.html#common
|
* @see https://httpd.apache.org/docs/2.4/logs.html#common
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
|
public const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}';
|
||||||
public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
|
public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
|
||||||
public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
|
public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
|
||||||
|
|
||||||
@@ -90,9 +90,9 @@ class MessageFormatter implements MessageFormatterInterface
|
|||||||
break;
|
break;
|
||||||
case 'req_headers':
|
case 'req_headers':
|
||||||
$result = \trim($request->getMethod()
|
$result = \trim($request->getMethod()
|
||||||
. ' ' . $request->getRequestTarget())
|
.' '.$request->getRequestTarget())
|
||||||
. ' HTTP/' . $request->getProtocolVersion() . "\r\n"
|
.' HTTP/'.$request->getProtocolVersion()."\r\n"
|
||||||
. $this->headers($request);
|
.$this->headers($request);
|
||||||
break;
|
break;
|
||||||
case 'res_headers':
|
case 'res_headers':
|
||||||
$result = $response ?
|
$result = $response ?
|
||||||
@@ -101,7 +101,7 @@ class MessageFormatter implements MessageFormatterInterface
|
|||||||
$response->getProtocolVersion(),
|
$response->getProtocolVersion(),
|
||||||
$response->getStatusCode(),
|
$response->getStatusCode(),
|
||||||
$response->getReasonPhrase()
|
$response->getReasonPhrase()
|
||||||
) . "\r\n" . $this->headers($response)
|
)."\r\n".$this->headers($response)
|
||||||
: 'NULL';
|
: 'NULL';
|
||||||
break;
|
break;
|
||||||
case 'req_body':
|
case 'req_body':
|
||||||
@@ -177,6 +177,7 @@ class MessageFormatter implements MessageFormatterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$cache[$matches[1]] = $result;
|
$cache[$matches[1]] = $result;
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
},
|
},
|
||||||
$this->template
|
$this->template
|
||||||
@@ -190,7 +191,7 @@ class MessageFormatter implements MessageFormatterInterface
|
|||||||
{
|
{
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach ($message->getHeaders() as $name => $values) {
|
foreach ($message->getHeaders() as $name => $values) {
|
||||||
$result .= $name . ': ' . \implode(', ', $values) . "\r\n";
|
$result .= $name.': '.\implode(', ', $values)."\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return \trim($result);
|
return \trim($result);
|
||||||
|
|||||||
@@ -34,10 +34,12 @@ final class Middleware
|
|||||||
}
|
}
|
||||||
$cookieJar = $options['cookies'];
|
$cookieJar = $options['cookies'];
|
||||||
$request = $cookieJar->withCookieHeader($request);
|
$request = $cookieJar->withCookieHeader($request);
|
||||||
|
|
||||||
return $handler($request, $options)
|
return $handler($request, $options)
|
||||||
->then(
|
->then(
|
||||||
static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
|
static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
|
||||||
$cookieJar->extractCookies($request, $response);
|
$cookieJar->extractCookies($request, $response);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -60,6 +62,7 @@ final class Middleware
|
|||||||
if (empty($options['http_errors'])) {
|
if (empty($options['http_errors'])) {
|
||||||
return $handler($request, $options);
|
return $handler($request, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $handler($request, $options)->then(
|
return $handler($request, $options)->then(
|
||||||
static function (ResponseInterface $response) use ($request, $bodySummarizer) {
|
static function (ResponseInterface $response) use ($request, $bodySummarizer) {
|
||||||
$code = $response->getStatusCode();
|
$code = $response->getStatusCode();
|
||||||
@@ -93,20 +96,22 @@ final class Middleware
|
|||||||
return $handler($request, $options)->then(
|
return $handler($request, $options)->then(
|
||||||
static function ($value) use ($request, &$container, $options) {
|
static function ($value) use ($request, &$container, $options) {
|
||||||
$container[] = [
|
$container[] = [
|
||||||
'request' => $request,
|
'request' => $request,
|
||||||
'response' => $value,
|
'response' => $value,
|
||||||
'error' => null,
|
'error' => null,
|
||||||
'options' => $options
|
'options' => $options,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
},
|
},
|
||||||
static function ($reason) use ($request, &$container, $options) {
|
static function ($reason) use ($request, &$container, $options) {
|
||||||
$container[] = [
|
$container[] = [
|
||||||
'request' => $request,
|
'request' => $request,
|
||||||
'response' => null,
|
'response' => null,
|
||||||
'error' => $reason,
|
'error' => $reason,
|
||||||
'options' => $options
|
'options' => $options,
|
||||||
];
|
];
|
||||||
|
|
||||||
return P\Create::rejectionFor($reason);
|
return P\Create::rejectionFor($reason);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -138,6 +143,7 @@ final class Middleware
|
|||||||
if ($after) {
|
if ($after) {
|
||||||
$after($request, $options, $response);
|
$after($request, $options, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -202,12 +208,14 @@ final class Middleware
|
|||||||
static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
|
static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
|
||||||
$message = $formatter->format($request, $response);
|
$message = $formatter->format($request, $response);
|
||||||
$logger->log($logLevel, $message);
|
$logger->log($logLevel, $message);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
},
|
},
|
||||||
static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
|
static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
|
||||||
$response = $reason instanceof RequestException ? $reason->getResponse() : null;
|
$response = $reason instanceof RequestException ? $reason->getResponse() : null;
|
||||||
$message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
|
$message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
|
||||||
$logger->error($message);
|
$logger->error($message);
|
||||||
|
|
||||||
return P\Create::rejectionFor($reason);
|
return P\Create::rejectionFor($reason);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class PrepareBodyMiddleware
|
|||||||
// The expect header is unconditionally enabled
|
// The expect header is unconditionally enabled
|
||||||
if ($expect === true) {
|
if ($expect === true) {
|
||||||
$modify['set_headers']['Expect'] = '100-Continue';
|
$modify['set_headers']['Expect'] = '100-Continue';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ class RedirectMiddleware
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $defaultSettings = [
|
public static $defaultSettings = [
|
||||||
'max' => 5,
|
'max' => 5,
|
||||||
'protocols' => ['http', 'https'],
|
'protocols' => ['http', 'https'],
|
||||||
'strict' => false,
|
'strict' => false,
|
||||||
'referer' => false,
|
'referer' => false,
|
||||||
'track_redirects' => false,
|
'track_redirects' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace GuzzleHttp;
|
|||||||
*
|
*
|
||||||
* More documentation for each option can be found at http://guzzlephp.org/.
|
* More documentation for each option can be found at http://guzzlephp.org/.
|
||||||
*
|
*
|
||||||
* @link http://docs.guzzlephp.org/en/v6/request-options.html
|
* @see http://docs.guzzlephp.org/en/v6/request-options.html
|
||||||
*/
|
*/
|
||||||
final class RequestOptions
|
final class RequestOptions
|
||||||
{
|
{
|
||||||
@@ -70,10 +70,22 @@ final class RequestOptions
|
|||||||
/**
|
/**
|
||||||
* connect_timeout: (float, default=0) Float describing the number of
|
* connect_timeout: (float, default=0) Float describing the number of
|
||||||
* seconds to wait while trying to connect to a server. Use 0 to wait
|
* seconds to wait while trying to connect to a server. Use 0 to wait
|
||||||
* indefinitely (the default behavior).
|
* 300 seconds (the default behavior).
|
||||||
*/
|
*/
|
||||||
public const CONNECT_TIMEOUT = 'connect_timeout';
|
public const CONNECT_TIMEOUT = 'connect_timeout';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* crypto_method: (int) A value describing the minimum TLS protocol
|
||||||
|
* version to use.
|
||||||
|
*
|
||||||
|
* This setting must be set to one of the
|
||||||
|
* ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
|
||||||
|
* required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
|
||||||
|
* in order to specify a crypto method, with cURL 7.52.0 or higher being
|
||||||
|
* required to use TLS 1.3.
|
||||||
|
*/
|
||||||
|
public const CRYPTO_METHOD = 'crypto_method';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* debug: (bool|resource) Set to true or set to a PHP stream returned by
|
* debug: (bool|resource) Set to true or set to a PHP stream returned by
|
||||||
* fopen() enable debug output with the HTTP handler used to send a
|
* fopen() enable debug output with the HTTP handler used to send a
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class RetryMiddleware
|
|||||||
{
|
{
|
||||||
$this->decider = $decider;
|
$this->decider = $decider;
|
||||||
$this->nextHandler = $nextHandler;
|
$this->nextHandler = $nextHandler;
|
||||||
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
|
$this->delay = $delay ?: __CLASS__.'::exponentialDelay';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,7 @@ class RetryMiddleware
|
|||||||
*/
|
*/
|
||||||
public static function exponentialDelay(int $retries): int
|
public static function exponentialDelay(int $retries): int
|
||||||
{
|
{
|
||||||
return (int) \pow(2, $retries - 1) * 1000;
|
return (int) 2 ** ($retries - 1) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __invoke(RequestInterface $request, array $options): PromiseInterface
|
public function __invoke(RequestInterface $request, array $options): PromiseInterface
|
||||||
@@ -64,6 +64,7 @@ class RetryMiddleware
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fn = $this->nextHandler;
|
$fn = $this->nextHandler;
|
||||||
|
|
||||||
return $fn($request, $options)
|
return $fn($request, $options)
|
||||||
->then(
|
->then(
|
||||||
$this->onFulfilled($request, $options),
|
$this->onFulfilled($request, $options),
|
||||||
@@ -85,6 +86,7 @@ class RetryMiddleware
|
|||||||
)) {
|
)) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->doRetry($request, $options, $value);
|
return $this->doRetry($request, $options, $value);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -103,13 +105,14 @@ class RetryMiddleware
|
|||||||
)) {
|
)) {
|
||||||
return P\Create::rejectionFor($reason);
|
return P\Create::rejectionFor($reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->doRetry($req, $options);
|
return $this->doRetry($req, $options);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
|
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
|
||||||
{
|
{
|
||||||
$options['delay'] = ($this->delay)(++$options['retries'], $response);
|
$options['delay'] = ($this->delay)(++$options['retries'], $response, $request);
|
||||||
|
|
||||||
return $this($request, $options);
|
return $this($request, $options);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ final class Utils
|
|||||||
{
|
{
|
||||||
switch (\gettype($input)) {
|
switch (\gettype($input)) {
|
||||||
case 'object':
|
case 'object':
|
||||||
return 'object(' . \get_class($input) . ')';
|
return 'object('.\get_class($input).')';
|
||||||
case 'array':
|
case 'array':
|
||||||
return 'array(' . \count($input) . ')';
|
return 'array('.\count($input).')';
|
||||||
default:
|
default:
|
||||||
\ob_start();
|
\ob_start();
|
||||||
\var_dump($input);
|
\var_dump($input);
|
||||||
@@ -79,19 +79,22 @@ final class Utils
|
|||||||
*
|
*
|
||||||
* The returned handler is not wrapped by any default middlewares.
|
* The returned handler is not wrapped by any default middlewares.
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException if no viable Handler is available.
|
|
||||||
*
|
|
||||||
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
|
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
|
||||||
|
*
|
||||||
|
* @throws \RuntimeException if no viable Handler is available.
|
||||||
*/
|
*/
|
||||||
public static function chooseHandler(): callable
|
public static function chooseHandler(): callable
|
||||||
{
|
{
|
||||||
$handler = null;
|
$handler = null;
|
||||||
if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
|
|
||||||
$handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
|
if (\defined('CURLOPT_CUSTOMREQUEST')) {
|
||||||
} elseif (\function_exists('curl_exec')) {
|
if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
|
||||||
$handler = new CurlHandler();
|
$handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
|
||||||
} elseif (\function_exists('curl_multi_exec')) {
|
} elseif (\function_exists('curl_exec')) {
|
||||||
$handler = new CurlMultiHandler();
|
$handler = new CurlHandler();
|
||||||
|
} elseif (\function_exists('curl_multi_exec')) {
|
||||||
|
$handler = new CurlMultiHandler();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\ini_get('allow_url_fopen')) {
|
if (\ini_get('allow_url_fopen')) {
|
||||||
@@ -244,8 +247,8 @@ EOT
|
|||||||
}
|
}
|
||||||
// Special match if the area when prefixed with ".". Remove any
|
// Special match if the area when prefixed with ".". Remove any
|
||||||
// existing leading "." and add a new leading ".".
|
// existing leading "." and add a new leading ".".
|
||||||
$area = '.' . \ltrim($area, '.');
|
$area = '.'.\ltrim($area, '.');
|
||||||
if (\substr($host, -(\strlen($area))) === $area) {
|
if (\substr($host, -\strlen($area)) === $area) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -266,13 +269,13 @@ EOT
|
|||||||
*
|
*
|
||||||
* @throws InvalidArgumentException if the JSON cannot be decoded.
|
* @throws InvalidArgumentException if the JSON cannot be decoded.
|
||||||
*
|
*
|
||||||
* @link https://www.php.net/manual/en/function.json-decode.php
|
* @see https://www.php.net/manual/en/function.json-decode.php
|
||||||
*/
|
*/
|
||||||
public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
|
public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
|
||||||
{
|
{
|
||||||
$data = \json_decode($json, $assoc, $depth, $options);
|
$data = \json_decode($json, $assoc, $depth, $options);
|
||||||
if (\JSON_ERROR_NONE !== \json_last_error()) {
|
if (\JSON_ERROR_NONE !== \json_last_error()) {
|
||||||
throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg());
|
throw new InvalidArgumentException('json_decode error: '.\json_last_error_msg());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
@@ -287,13 +290,13 @@ EOT
|
|||||||
*
|
*
|
||||||
* @throws InvalidArgumentException if the JSON cannot be encoded.
|
* @throws InvalidArgumentException if the JSON cannot be encoded.
|
||||||
*
|
*
|
||||||
* @link https://www.php.net/manual/en/function.json-encode.php
|
* @see https://www.php.net/manual/en/function.json-encode.php
|
||||||
*/
|
*/
|
||||||
public static function jsonEncode($value, int $options = 0, int $depth = 512): string
|
public static function jsonEncode($value, int $options = 0, int $depth = 512): string
|
||||||
{
|
{
|
||||||
$json = \json_encode($value, $options, $depth);
|
$json = \json_encode($value, $options, $depth);
|
||||||
if (\JSON_ERROR_NONE !== \json_last_error()) {
|
if (\JSON_ERROR_NONE !== \json_last_error()) {
|
||||||
throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
|
throw new InvalidArgumentException('json_encode error: '.\json_last_error_msg());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
@@ -338,7 +341,7 @@ EOT
|
|||||||
|
|
||||||
$errorMessage = 'IDN conversion failed';
|
$errorMessage = 'IDN conversion failed';
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
|
$errorMessage .= ' (errors: '.implode(', ', $errors).')';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidArgumentException($errorMessage);
|
throw new InvalidArgumentException($errorMessage);
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ function debug_resource($value = null)
|
|||||||
*
|
*
|
||||||
* The returned handler is not wrapped by any default middlewares.
|
* The returned handler is not wrapped by any default middlewares.
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException if no viable Handler is available.
|
|
||||||
*
|
|
||||||
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
|
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
|
||||||
*
|
*
|
||||||
|
* @throws \RuntimeException if no viable Handler is available.
|
||||||
|
*
|
||||||
* @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
|
* @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
|
||||||
*/
|
*/
|
||||||
function choose_handler(): callable
|
function choose_handler(): callable
|
||||||
@@ -141,7 +141,7 @@ function is_host_in_noproxy(string $host, array $noProxyArray): bool
|
|||||||
*
|
*
|
||||||
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
|
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
|
||||||
*
|
*
|
||||||
* @link https://www.php.net/manual/en/function.json-decode.php
|
* @see https://www.php.net/manual/en/function.json-decode.php
|
||||||
* @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
|
* @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
|
||||||
*/
|
*/
|
||||||
function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
|
function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
|
||||||
@@ -158,7 +158,7 @@ function json_decode(string $json, bool $assoc = false, int $depth = 512, int $o
|
|||||||
*
|
*
|
||||||
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
|
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
|
||||||
*
|
*
|
||||||
* @link https://www.php.net/manual/en/function.json-encode.php
|
* @see https://www.php.net/manual/en/function.json-encode.php
|
||||||
* @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
|
* @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
|
||||||
*/
|
*/
|
||||||
function json_encode($value, int $options = 0, int $depth = 512): string
|
function json_encode($value, int $options = 0, int $depth = 512): string
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
// Don't redefine the functions if included multiple times.
|
// Don't redefine the functions if included multiple times.
|
||||||
if (!\function_exists('GuzzleHttp\describe_type')) {
|
if (!\function_exists('GuzzleHttp\describe_type')) {
|
||||||
require __DIR__ . '/functions.php';
|
require __DIR__.'/functions.php';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
|
||||||
|
## 2.0.0 - TBC
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added PHP 7 type hints
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- All previously non-final non-exception classes have been marked as soft-final
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Dropped PHP < 7.2 support
|
||||||
|
- All functions in the `GuzzleHttp\Promise` namespace
|
||||||
|
|
||||||
|
|
||||||
|
## 1.5.3 - 2023-05-21
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Removed remaining usage of deprecated functions
|
||||||
|
|
||||||
|
|
||||||
|
## 1.5.2 - 2022-08-07
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Officially support PHP 8.2
|
||||||
|
|
||||||
|
|
||||||
## 1.5.1 - 2021-10-22
|
## 1.5.1 - 2021-10-22
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -7,15 +38,18 @@
|
|||||||
- Revert "Call handler when waiting on fulfilled/rejected Promise"
|
- Revert "Call handler when waiting on fulfilled/rejected Promise"
|
||||||
- Fix pool memory leak when empty array of promises provided
|
- Fix pool memory leak when empty array of promises provided
|
||||||
|
|
||||||
|
|
||||||
## 1.5.0 - 2021-10-07
|
## 1.5.0 - 2021-10-07
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Call handler when waiting on fulfilled/rejected Promise
|
- Call handler when waiting on fulfilled/rejected Promise
|
||||||
|
- Officially support PHP 8.1
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix manually settle promises generated with Utils::task
|
- Fix manually settle promises generated with `Utils::task`
|
||||||
|
|
||||||
|
|
||||||
## 1.4.1 - 2021-02-18
|
## 1.4.1 - 2021-02-18
|
||||||
|
|
||||||
@@ -23,6 +57,7 @@
|
|||||||
|
|
||||||
- Fixed `each_limit` skipping promises and failing
|
- Fixed `each_limit` skipping promises and failing
|
||||||
|
|
||||||
|
|
||||||
## 1.4.0 - 2020-09-30
|
## 1.4.0 - 2020-09-30
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
all: clean test
|
|
||||||
|
|
||||||
test:
|
|
||||||
vendor/bin/phpunit
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
vendor/bin/phpunit --coverage-html=artifacts/coverage
|
|
||||||
|
|
||||||
view-coverage:
|
|
||||||
open artifacts/coverage/index.html
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf artifacts/*
|
|
||||||
@@ -17,7 +17,7 @@ for a general introduction to promises.
|
|||||||
- [Implementation notes](#implementation-notes)
|
- [Implementation notes](#implementation-notes)
|
||||||
|
|
||||||
|
|
||||||
# Features
|
## Features
|
||||||
|
|
||||||
- [Promises/A+](https://promisesaplus.com/) implementation.
|
- [Promises/A+](https://promisesaplus.com/) implementation.
|
||||||
- Promise resolution and chaining is handled iteratively, allowing for
|
- Promise resolution and chaining is handled iteratively, allowing for
|
||||||
@@ -29,15 +29,29 @@ for a general introduction to promises.
|
|||||||
`GuzzleHttp\Promise\Coroutine::of()`.
|
`GuzzleHttp\Promise\Coroutine::of()`.
|
||||||
|
|
||||||
|
|
||||||
# Quick start
|
## Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
composer require guzzlehttp/promises
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Version Guidance
|
||||||
|
|
||||||
|
| Version | Status | PHP Version |
|
||||||
|
|---------|------------------------|--------------|
|
||||||
|
| 1.x | Bug and security fixes | >=5.5,<8.3 |
|
||||||
|
| 2.x | Latest | >=7.2.5,<8.3 |
|
||||||
|
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
A *promise* represents the eventual result of an asynchronous operation. The
|
A *promise* represents the eventual result of an asynchronous operation. The
|
||||||
primary way of interacting with a promise is through its `then` method, which
|
primary way of interacting with a promise is through its `then` method, which
|
||||||
registers callbacks to receive either a promise's eventual value or the reason
|
registers callbacks to receive either a promise's eventual value or the reason
|
||||||
why the promise cannot be fulfilled.
|
why the promise cannot be fulfilled.
|
||||||
|
|
||||||
|
### Callbacks
|
||||||
## Callbacks
|
|
||||||
|
|
||||||
Callbacks are registered with the `then` method by providing an optional
|
Callbacks are registered with the `then` method by providing an optional
|
||||||
`$onFulfilled` followed by an optional `$onRejected` function.
|
`$onFulfilled` followed by an optional `$onRejected` function.
|
||||||
@@ -60,12 +74,11 @@ $promise->then(
|
|||||||
```
|
```
|
||||||
|
|
||||||
*Resolving* a promise means that you either fulfill a promise with a *value* or
|
*Resolving* a promise means that you either fulfill a promise with a *value* or
|
||||||
reject a promise with a *reason*. Resolving a promises triggers callbacks
|
reject a promise with a *reason*. Resolving a promise triggers callbacks
|
||||||
registered with the promises's `then` method. These callbacks are triggered
|
registered with the promise's `then` method. These callbacks are triggered
|
||||||
only once and in the order in which they were added.
|
only once and in the order in which they were added.
|
||||||
|
|
||||||
|
### Resolving a Promise
|
||||||
## Resolving a promise
|
|
||||||
|
|
||||||
Promises are fulfilled using the `resolve($value)` method. Resolving a promise
|
Promises are fulfilled using the `resolve($value)` method. Resolving a promise
|
||||||
with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
|
with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
|
||||||
@@ -92,8 +105,7 @@ $promise
|
|||||||
$promise->resolve('reader.');
|
$promise->resolve('reader.');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Promise Forwarding
|
||||||
## Promise forwarding
|
|
||||||
|
|
||||||
Promises can be chained one after the other. Each then in the chain is a new
|
Promises can be chained one after the other. Each then in the chain is a new
|
||||||
promise. The return value of a promise is what's forwarded to the next
|
promise. The return value of a promise is what's forwarded to the next
|
||||||
@@ -123,7 +135,7 @@ $promise->resolve('A');
|
|||||||
$nextPromise->resolve('B');
|
$nextPromise->resolve('B');
|
||||||
```
|
```
|
||||||
|
|
||||||
## Promise rejection
|
### Promise Rejection
|
||||||
|
|
||||||
When a promise is rejected, the `$onRejected` callbacks are invoked with the
|
When a promise is rejected, the `$onRejected` callbacks are invoked with the
|
||||||
rejection reason.
|
rejection reason.
|
||||||
@@ -140,7 +152,7 @@ $promise->reject('Error!');
|
|||||||
// Outputs "Error!"
|
// Outputs "Error!"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rejection forwarding
|
### Rejection Forwarding
|
||||||
|
|
||||||
If an exception is thrown in an `$onRejected` callback, subsequent
|
If an exception is thrown in an `$onRejected` callback, subsequent
|
||||||
`$onRejected` callbacks are invoked with the thrown exception as the reason.
|
`$onRejected` callbacks are invoked with the thrown exception as the reason.
|
||||||
@@ -195,7 +207,8 @@ $promise
|
|||||||
$promise->reject('Error!');
|
$promise->reject('Error!');
|
||||||
```
|
```
|
||||||
|
|
||||||
# Synchronous wait
|
|
||||||
|
## Synchronous Wait
|
||||||
|
|
||||||
You can synchronously force promises to complete using a promise's `wait`
|
You can synchronously force promises to complete using a promise's `wait`
|
||||||
method. When creating a promise, you can provide a wait function that is used
|
method. When creating a promise, you can provide a wait function that is used
|
||||||
@@ -247,8 +260,7 @@ $promise->wait();
|
|||||||
|
|
||||||
> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
|
> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
|
||||||
|
|
||||||
|
### Unwrapping a Promise
|
||||||
## Unwrapping a promise
|
|
||||||
|
|
||||||
When synchronously waiting on a promise, you are joining the state of the
|
When synchronously waiting on a promise, you are joining the state of the
|
||||||
promise into the current state of execution (i.e., return the value of the
|
promise into the current state of execution (i.e., return the value of the
|
||||||
@@ -275,7 +287,7 @@ wait function will be the value delivered to promise B.
|
|||||||
**Note**: when you do not unwrap the promise, no value is returned.
|
**Note**: when you do not unwrap the promise, no value is returned.
|
||||||
|
|
||||||
|
|
||||||
# Cancellation
|
## Cancellation
|
||||||
|
|
||||||
You can cancel a promise that has not yet been fulfilled using the `cancel()`
|
You can cancel a promise that has not yet been fulfilled using the `cancel()`
|
||||||
method of a promise. When creating a promise you can provide an optional
|
method of a promise. When creating a promise you can provide an optional
|
||||||
@@ -283,10 +295,9 @@ cancel function that when invoked cancels the action of computing a resolution
|
|||||||
of the promise.
|
of the promise.
|
||||||
|
|
||||||
|
|
||||||
# API
|
## API
|
||||||
|
|
||||||
|
### Promise
|
||||||
## Promise
|
|
||||||
|
|
||||||
When creating a promise object, you can provide an optional `$waitFn` and
|
When creating a promise object, you can provide an optional `$waitFn` and
|
||||||
`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
|
`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
|
||||||
@@ -349,7 +360,7 @@ A promise has the following methods:
|
|||||||
Rejects the promise with the given `$reason`.
|
Rejects the promise with the given `$reason`.
|
||||||
|
|
||||||
|
|
||||||
## FulfilledPromise
|
### FulfilledPromise
|
||||||
|
|
||||||
A fulfilled promise can be created to represent a promise that has been
|
A fulfilled promise can be created to represent a promise that has been
|
||||||
fulfilled.
|
fulfilled.
|
||||||
@@ -366,7 +377,7 @@ $promise->then(function ($value) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## RejectedPromise
|
### RejectedPromise
|
||||||
|
|
||||||
A rejected promise can be created to represent a promise that has been
|
A rejected promise can be created to represent a promise that has been
|
||||||
rejected.
|
rejected.
|
||||||
@@ -383,7 +394,7 @@ $promise->then(null, function ($reason) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# Promise interop
|
## Promise Interoperability
|
||||||
|
|
||||||
This library works with foreign promises that have a `then` method. This means
|
This library works with foreign promises that have a `then` method. This means
|
||||||
you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
|
you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
|
||||||
@@ -409,7 +420,7 @@ a foreign promise. You will need to wrap a third-party promise with a Guzzle
|
|||||||
promise in order to utilize wait and cancel functions with foreign promises.
|
promise in order to utilize wait and cancel functions with foreign promises.
|
||||||
|
|
||||||
|
|
||||||
## Event Loop Integration
|
### Event Loop Integration
|
||||||
|
|
||||||
In order to keep the stack size constant, Guzzle promises are resolved
|
In order to keep the stack size constant, Guzzle promises are resolved
|
||||||
asynchronously using a task queue. When waiting on promises synchronously, the
|
asynchronously using a task queue. When waiting on promises synchronously, the
|
||||||
@@ -434,13 +445,10 @@ $loop = React\EventLoop\Factory::create();
|
|||||||
$loop->addPeriodicTimer(0, [$queue, 'run']);
|
$loop->addPeriodicTimer(0, [$queue, 'run']);
|
||||||
```
|
```
|
||||||
|
|
||||||
*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
|
|
||||||
|
|
||||||
|
## Implementation Notes
|
||||||
|
|
||||||
# Implementation notes
|
### Promise Resolution and Chaining is Handled Iteratively
|
||||||
|
|
||||||
|
|
||||||
## Promise resolution and chaining is handled iteratively
|
|
||||||
|
|
||||||
By shuffling pending handlers from one owner to another, promises are
|
By shuffling pending handlers from one owner to another, promises are
|
||||||
resolved iteratively, allowing for "infinite" then chaining.
|
resolved iteratively, allowing for "infinite" then chaining.
|
||||||
@@ -476,8 +484,7 @@ all of its pending handlers to the new promise. When the new promise is
|
|||||||
eventually resolved, all of the pending handlers are delivered the forwarded
|
eventually resolved, all of the pending handlers are delivered the forwarded
|
||||||
value.
|
value.
|
||||||
|
|
||||||
|
### A Promise is the Deferred
|
||||||
## A promise is the deferred.
|
|
||||||
|
|
||||||
Some promise libraries implement promises using a deferred object to represent
|
Some promise libraries implement promises using a deferred object to represent
|
||||||
a computation and a promise object to represent the delivery of the result of
|
a computation and a promise object to represent the delivery of the result of
|
||||||
@@ -505,7 +512,10 @@ $promise->resolve('foo');
|
|||||||
|
|
||||||
## Upgrading from Function API
|
## Upgrading from Function API
|
||||||
|
|
||||||
A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
|
A static API was first introduced in 1.4.0, in order to mitigate problems with
|
||||||
|
functions conflicting between global and local copies of the package. The
|
||||||
|
function API was removed in 2.0.0. A migration table has been provided here for
|
||||||
|
your convenience:
|
||||||
|
|
||||||
| Original Function | Replacement Method |
|
| Original Function | Replacement Method |
|
||||||
|----------------|----------------|
|
|----------------|----------------|
|
||||||
@@ -536,10 +546,12 @@ A static API was first introduced in 1.4.0, in order to mitigate problems with f
|
|||||||
|
|
||||||
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
|
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
|
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
|
||||||
|
|
||||||
|
|
||||||
## For Enterprise
|
## For Enterprise
|
||||||
|
|
||||||
Available as part of the Tidelift Subscription
|
Available as part of the Tidelift Subscription
|
||||||
|
|||||||
@@ -26,32 +26,32 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5"
|
"php": "^7.2.5 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "^4.4 || ^5.1"
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GuzzleHttp\\Promise\\": "src/"
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
},
|
}
|
||||||
"files": ["src/functions_include.php"]
|
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GuzzleHttp\\Promise\\Tests\\": "tests/"
|
"GuzzleHttp\\Promise\\Tests\\": "tests/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
|
||||||
"test": "vendor/bin/simple-phpunit",
|
|
||||||
"test-ci": "vendor/bin/simple-phpunit --coverage-text"
|
|
||||||
},
|
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "1.5-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"bamarni/composer-bin-plugin": true
|
||||||
|
},
|
||||||
"preferred-install": "dist",
|
"preferred-install": "dist",
|
||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,7 +9,7 @@ namespace GuzzleHttp\Promise;
|
|||||||
*/
|
*/
|
||||||
class AggregateException extends RejectionException
|
class AggregateException extends RejectionException
|
||||||
{
|
{
|
||||||
public function __construct($msg, array $reasons)
|
public function __construct(string $msg, array $reasons)
|
||||||
{
|
{
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$reasons,
|
$reasons,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ use Throwable;
|
|||||||
* $value = (yield createPromise('a'));
|
* $value = (yield createPromise('a'));
|
||||||
* try {
|
* try {
|
||||||
* $value = (yield createPromise($value . 'b'));
|
* $value = (yield createPromise($value . 'b'));
|
||||||
* } catch (\Exception $e) {
|
* } catch (\Throwable $e) {
|
||||||
* // The promise was rejected.
|
* // The promise was rejected.
|
||||||
* }
|
* }
|
||||||
* yield $value . 'c';
|
* yield $value . 'c';
|
||||||
@@ -40,7 +41,7 @@ use Throwable;
|
|||||||
*
|
*
|
||||||
* @return Promise
|
* @return Promise
|
||||||
*
|
*
|
||||||
* @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
|
* @see https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
|
||||||
*/
|
*/
|
||||||
final class Coroutine implements PromiseInterface
|
final class Coroutine implements PromiseInterface
|
||||||
{
|
{
|
||||||
@@ -62,15 +63,13 @@ final class Coroutine implements PromiseInterface
|
|||||||
public function __construct(callable $generatorFn)
|
public function __construct(callable $generatorFn)
|
||||||
{
|
{
|
||||||
$this->generator = $generatorFn();
|
$this->generator = $generatorFn();
|
||||||
$this->result = new Promise(function () {
|
$this->result = new Promise(function (): void {
|
||||||
while (isset($this->currentPromise)) {
|
while (isset($this->currentPromise)) {
|
||||||
$this->currentPromise->wait();
|
$this->currentPromise->wait();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
$this->nextCoroutine($this->generator->current());
|
$this->nextCoroutine($this->generator->current());
|
||||||
} catch (\Exception $exception) {
|
|
||||||
$this->result->reject($exception);
|
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
$this->result->reject($throwable);
|
$this->result->reject($throwable);
|
||||||
}
|
}
|
||||||
@@ -78,10 +77,8 @@ final class Coroutine implements PromiseInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new coroutine.
|
* Create a new coroutine.
|
||||||
*
|
|
||||||
* @return self
|
|
||||||
*/
|
*/
|
||||||
public static function of(callable $generatorFn)
|
public static function of(callable $generatorFn): self
|
||||||
{
|
{
|
||||||
return new self($generatorFn);
|
return new self($generatorFn);
|
||||||
}
|
}
|
||||||
@@ -89,42 +86,42 @@ final class Coroutine implements PromiseInterface
|
|||||||
public function then(
|
public function then(
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
return $this->result->then($onFulfilled, $onRejected);
|
return $this->result->then($onFulfilled, $onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function otherwise(callable $onRejected)
|
public function otherwise(callable $onRejected): PromiseInterface
|
||||||
{
|
{
|
||||||
return $this->result->otherwise($onRejected);
|
return $this->result->otherwise($onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wait($unwrap = true)
|
public function wait(bool $unwrap = true)
|
||||||
{
|
{
|
||||||
return $this->result->wait($unwrap);
|
return $this->result->wait($unwrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getState()
|
public function getState(): string
|
||||||
{
|
{
|
||||||
return $this->result->getState();
|
return $this->result->getState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolve($value)
|
public function resolve($value): void
|
||||||
{
|
{
|
||||||
$this->result->resolve($value);
|
$this->result->resolve($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reject($reason)
|
public function reject($reason): void
|
||||||
{
|
{
|
||||||
$this->result->reject($reason);
|
$this->result->reject($reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel(): void
|
||||||
{
|
{
|
||||||
$this->currentPromise->cancel();
|
$this->currentPromise->cancel();
|
||||||
$this->result->cancel();
|
$this->result->cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function nextCoroutine($yielded)
|
private function nextCoroutine($yielded): void
|
||||||
{
|
{
|
||||||
$this->currentPromise = Create::promiseFor($yielded)
|
$this->currentPromise = Create::promiseFor($yielded)
|
||||||
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
|
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
|
||||||
@@ -133,7 +130,7 @@ final class Coroutine implements PromiseInterface
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function _handleSuccess($value)
|
public function _handleSuccess($value): void
|
||||||
{
|
{
|
||||||
unset($this->currentPromise);
|
unset($this->currentPromise);
|
||||||
try {
|
try {
|
||||||
@@ -143,8 +140,6 @@ final class Coroutine implements PromiseInterface
|
|||||||
} else {
|
} else {
|
||||||
$this->result->resolve($value);
|
$this->result->resolve($value);
|
||||||
}
|
}
|
||||||
} catch (Exception $exception) {
|
|
||||||
$this->result->reject($exception);
|
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
$this->result->reject($throwable);
|
$this->result->reject($throwable);
|
||||||
}
|
}
|
||||||
@@ -153,15 +148,13 @@ final class Coroutine implements PromiseInterface
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function _handleFailure($reason)
|
public function _handleFailure($reason): void
|
||||||
{
|
{
|
||||||
unset($this->currentPromise);
|
unset($this->currentPromise);
|
||||||
try {
|
try {
|
||||||
$nextYield = $this->generator->throw(Create::exceptionFor($reason));
|
$nextYield = $this->generator->throw(Create::exceptionFor($reason));
|
||||||
// The throw was caught, so keep iterating on the coroutine
|
// The throw was caught, so keep iterating on the coroutine
|
||||||
$this->nextCoroutine($nextYield);
|
$this->nextCoroutine($nextYield);
|
||||||
} catch (Exception $exception) {
|
|
||||||
$this->result->reject($exception);
|
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
$this->result->reject($throwable);
|
$this->result->reject($throwable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
final class Create
|
final class Create
|
||||||
@@ -8,10 +10,8 @@ final class Create
|
|||||||
* Creates a promise for a value if the value is not a promise.
|
* Creates a promise for a value if the value is not a promise.
|
||||||
*
|
*
|
||||||
* @param mixed $value Promise or value.
|
* @param mixed $value Promise or value.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function promiseFor($value)
|
public static function promiseFor($value): PromiseInterface
|
||||||
{
|
{
|
||||||
if ($value instanceof PromiseInterface) {
|
if ($value instanceof PromiseInterface) {
|
||||||
return $value;
|
return $value;
|
||||||
@@ -23,6 +23,7 @@ final class Create
|
|||||||
$cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
|
$cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
|
||||||
$promise = new Promise($wfn, $cfn);
|
$promise = new Promise($wfn, $cfn);
|
||||||
$value->then([$promise, 'resolve'], [$promise, 'reject']);
|
$value->then([$promise, 'resolve'], [$promise, 'reject']);
|
||||||
|
|
||||||
return $promise;
|
return $promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,10 +35,8 @@ final class Create
|
|||||||
* If the provided reason is a promise, then it is returned as-is.
|
* If the provided reason is a promise, then it is returned as-is.
|
||||||
*
|
*
|
||||||
* @param mixed $reason Promise or reason.
|
* @param mixed $reason Promise or reason.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function rejectionFor($reason)
|
public static function rejectionFor($reason): PromiseInterface
|
||||||
{
|
{
|
||||||
if ($reason instanceof PromiseInterface) {
|
if ($reason instanceof PromiseInterface) {
|
||||||
return $reason;
|
return $reason;
|
||||||
@@ -50,12 +49,10 @@ final class Create
|
|||||||
* Create an exception for a rejected promise value.
|
* Create an exception for a rejected promise value.
|
||||||
*
|
*
|
||||||
* @param mixed $reason
|
* @param mixed $reason
|
||||||
*
|
|
||||||
* @return \Exception|\Throwable
|
|
||||||
*/
|
*/
|
||||||
public static function exceptionFor($reason)
|
public static function exceptionFor($reason): \Throwable
|
||||||
{
|
{
|
||||||
if ($reason instanceof \Exception || $reason instanceof \Throwable) {
|
if ($reason instanceof \Throwable) {
|
||||||
return $reason;
|
return $reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,10 +63,8 @@ final class Create
|
|||||||
* Returns an iterator for the given value.
|
* Returns an iterator for the given value.
|
||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
*
|
|
||||||
* @return \Iterator
|
|
||||||
*/
|
*/
|
||||||
public static function iterFor($value)
|
public static function iterFor($value): \Iterator
|
||||||
{
|
{
|
||||||
if ($value instanceof \Iterator) {
|
if ($value instanceof \Iterator) {
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
final class Each
|
final class Each
|
||||||
@@ -20,17 +22,15 @@ final class Each
|
|||||||
* @param mixed $iterable Iterator or array to iterate over.
|
* @param mixed $iterable Iterator or array to iterate over.
|
||||||
* @param callable $onFulfilled
|
* @param callable $onFulfilled
|
||||||
* @param callable $onRejected
|
* @param callable $onRejected
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function of(
|
public static function of(
|
||||||
$iterable,
|
$iterable,
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
return (new EachPromise($iterable, [
|
return (new EachPromise($iterable, [
|
||||||
'fulfilled' => $onFulfilled,
|
'fulfilled' => $onFulfilled,
|
||||||
'rejected' => $onRejected
|
'rejected' => $onRejected,
|
||||||
]))->promise();
|
]))->promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,19 +46,17 @@ final class Each
|
|||||||
* @param int|callable $concurrency
|
* @param int|callable $concurrency
|
||||||
* @param callable $onFulfilled
|
* @param callable $onFulfilled
|
||||||
* @param callable $onRejected
|
* @param callable $onRejected
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function ofLimit(
|
public static function ofLimit(
|
||||||
$iterable,
|
$iterable,
|
||||||
$concurrency,
|
$concurrency,
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
return (new EachPromise($iterable, [
|
return (new EachPromise($iterable, [
|
||||||
'fulfilled' => $onFulfilled,
|
'fulfilled' => $onFulfilled,
|
||||||
'rejected' => $onRejected,
|
'rejected' => $onRejected,
|
||||||
'concurrency' => $concurrency
|
'concurrency' => $concurrency,
|
||||||
]))->promise();
|
]))->promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,19 +68,17 @@ final class Each
|
|||||||
* @param mixed $iterable
|
* @param mixed $iterable
|
||||||
* @param int|callable $concurrency
|
* @param int|callable $concurrency
|
||||||
* @param callable $onFulfilled
|
* @param callable $onFulfilled
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function ofLimitAll(
|
public static function ofLimitAll(
|
||||||
$iterable,
|
$iterable,
|
||||||
$concurrency,
|
$concurrency,
|
||||||
callable $onFulfilled = null
|
callable $onFulfilled = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
return each_limit(
|
return self::ofLimit(
|
||||||
$iterable,
|
$iterable,
|
||||||
$concurrency,
|
$concurrency,
|
||||||
$onFulfilled,
|
$onFulfilled,
|
||||||
function ($reason, $idx, PromiseInterface $aggregate) {
|
function ($reason, $idx, PromiseInterface $aggregate): void {
|
||||||
$aggregate->reject($reason);
|
$aggregate->reject($reason);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a promise that iterates over many promises and invokes
|
* Represents a promise that iterates over many promises and invokes
|
||||||
* side-effect functions in the process.
|
* side-effect functions in the process.
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class EachPromise implements PromisorInterface
|
class EachPromise implements PromisorInterface
|
||||||
{
|
{
|
||||||
@@ -69,7 +73,7 @@ class EachPromise implements PromisorInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress InvalidNullableReturnType */
|
/** @psalm-suppress InvalidNullableReturnType */
|
||||||
public function promise()
|
public function promise(): PromiseInterface
|
||||||
{
|
{
|
||||||
if ($this->aggregate) {
|
if ($this->aggregate) {
|
||||||
return $this->aggregate;
|
return $this->aggregate;
|
||||||
@@ -81,30 +85,19 @@ class EachPromise implements PromisorInterface
|
|||||||
$this->iterable->rewind();
|
$this->iterable->rewind();
|
||||||
$this->refillPending();
|
$this->refillPending();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
/**
|
|
||||||
* @psalm-suppress NullReference
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
$this->aggregate->reject($e);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
/**
|
|
||||||
* @psalm-suppress NullReference
|
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
|
||||||
$this->aggregate->reject($e);
|
$this->aggregate->reject($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-suppress NullableReturnStatement
|
* @psalm-suppress NullableReturnStatement
|
||||||
* @phpstan-ignore-next-line
|
|
||||||
*/
|
*/
|
||||||
return $this->aggregate;
|
return $this->aggregate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createPromise()
|
private function createPromise(): void
|
||||||
{
|
{
|
||||||
$this->mutex = false;
|
$this->mutex = false;
|
||||||
$this->aggregate = new Promise(function () {
|
$this->aggregate = new Promise(function (): void {
|
||||||
if ($this->checkIfFinished()) {
|
if ($this->checkIfFinished()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -121,7 +114,7 @@ class EachPromise implements PromisorInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Clear the references when the promise is resolved.
|
// Clear the references when the promise is resolved.
|
||||||
$clearFn = function () {
|
$clearFn = function (): void {
|
||||||
$this->iterable = $this->concurrency = $this->pending = null;
|
$this->iterable = $this->concurrency = $this->pending = null;
|
||||||
$this->onFulfilled = $this->onRejected = null;
|
$this->onFulfilled = $this->onRejected = null;
|
||||||
$this->nextPendingIndex = 0;
|
$this->nextPendingIndex = 0;
|
||||||
@@ -130,11 +123,13 @@ class EachPromise implements PromisorInterface
|
|||||||
$this->aggregate->then($clearFn, $clearFn);
|
$this->aggregate->then($clearFn, $clearFn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function refillPending()
|
private function refillPending(): void
|
||||||
{
|
{
|
||||||
if (!$this->concurrency) {
|
if (!$this->concurrency) {
|
||||||
// Add all pending promises.
|
// Add all pending promises.
|
||||||
while ($this->addPending() && $this->advanceIterator());
|
while ($this->addPending() && $this->advanceIterator()) {
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,10 +150,11 @@ class EachPromise implements PromisorInterface
|
|||||||
// next value to yield until promise callbacks are called.
|
// next value to yield until promise callbacks are called.
|
||||||
while (--$concurrency
|
while (--$concurrency
|
||||||
&& $this->advanceIterator()
|
&& $this->advanceIterator()
|
||||||
&& $this->addPending());
|
&& $this->addPending()) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addPending()
|
private function addPending(): bool
|
||||||
{
|
{
|
||||||
if (!$this->iterable || !$this->iterable->valid()) {
|
if (!$this->iterable || !$this->iterable->valid()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -172,7 +168,7 @@ class EachPromise implements PromisorInterface
|
|||||||
$idx = $this->nextPendingIndex++;
|
$idx = $this->nextPendingIndex++;
|
||||||
|
|
||||||
$this->pending[$idx] = $promise->then(
|
$this->pending[$idx] = $promise->then(
|
||||||
function ($value) use ($idx, $key) {
|
function ($value) use ($idx, $key): void {
|
||||||
if ($this->onFulfilled) {
|
if ($this->onFulfilled) {
|
||||||
call_user_func(
|
call_user_func(
|
||||||
$this->onFulfilled,
|
$this->onFulfilled,
|
||||||
@@ -183,7 +179,7 @@ class EachPromise implements PromisorInterface
|
|||||||
}
|
}
|
||||||
$this->step($idx);
|
$this->step($idx);
|
||||||
},
|
},
|
||||||
function ($reason) use ($idx, $key) {
|
function ($reason) use ($idx, $key): void {
|
||||||
if ($this->onRejected) {
|
if ($this->onRejected) {
|
||||||
call_user_func(
|
call_user_func(
|
||||||
$this->onRejected,
|
$this->onRejected,
|
||||||
@@ -199,7 +195,7 @@ class EachPromise implements PromisorInterface
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function advanceIterator()
|
private function advanceIterator(): bool
|
||||||
{
|
{
|
||||||
// Place a lock on the iterator so that we ensure to not recurse,
|
// Place a lock on the iterator so that we ensure to not recurse,
|
||||||
// preventing fatal generator errors.
|
// preventing fatal generator errors.
|
||||||
@@ -212,19 +208,17 @@ class EachPromise implements PromisorInterface
|
|||||||
try {
|
try {
|
||||||
$this->iterable->next();
|
$this->iterable->next();
|
||||||
$this->mutex = false;
|
$this->mutex = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->aggregate->reject($e);
|
$this->aggregate->reject($e);
|
||||||
$this->mutex = false;
|
$this->mutex = false;
|
||||||
return false;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->aggregate->reject($e);
|
|
||||||
$this->mutex = false;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function step($idx)
|
private function step(int $idx): void
|
||||||
{
|
{
|
||||||
// If the promise was already resolved, then ignore this step.
|
// If the promise was already resolved, then ignore this step.
|
||||||
if (Is::settled($this->aggregate)) {
|
if (Is::settled($this->aggregate)) {
|
||||||
@@ -242,11 +236,12 @@ class EachPromise implements PromisorInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkIfFinished()
|
private function checkIfFinished(): bool
|
||||||
{
|
{
|
||||||
if (!$this->pending && !$this->iterable->valid()) {
|
if (!$this->pending && !$this->iterable->valid()) {
|
||||||
// Resolve the promise if there's nothing left to do.
|
// Resolve the promise if there's nothing left to do.
|
||||||
$this->aggregate->resolve(null);
|
$this->aggregate->resolve(null);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,11 +9,16 @@ namespace GuzzleHttp\Promise;
|
|||||||
*
|
*
|
||||||
* Thenning off of this promise will invoke the onFulfilled callback
|
* Thenning off of this promise will invoke the onFulfilled callback
|
||||||
* immediately and ignore other callbacks.
|
* immediately and ignore other callbacks.
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class FulfilledPromise implements PromiseInterface
|
class FulfilledPromise implements PromiseInterface
|
||||||
{
|
{
|
||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $value
|
||||||
|
*/
|
||||||
public function __construct($value)
|
public function __construct($value)
|
||||||
{
|
{
|
||||||
if (is_object($value) && method_exists($value, 'then')) {
|
if (is_object($value) && method_exists($value, 'then')) {
|
||||||
@@ -26,7 +33,7 @@ class FulfilledPromise implements PromiseInterface
|
|||||||
public function then(
|
public function then(
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
// Return itself if there is no onFulfilled function.
|
// Return itself if there is no onFulfilled function.
|
||||||
if (!$onFulfilled) {
|
if (!$onFulfilled) {
|
||||||
return $this;
|
return $this;
|
||||||
@@ -35,14 +42,12 @@ class FulfilledPromise implements PromiseInterface
|
|||||||
$queue = Utils::queue();
|
$queue = Utils::queue();
|
||||||
$p = new Promise([$queue, 'run']);
|
$p = new Promise([$queue, 'run']);
|
||||||
$value = $this->value;
|
$value = $this->value;
|
||||||
$queue->add(static function () use ($p, $value, $onFulfilled) {
|
$queue->add(static function () use ($p, $value, $onFulfilled): void {
|
||||||
if (Is::pending($p)) {
|
if (Is::pending($p)) {
|
||||||
try {
|
try {
|
||||||
$p->resolve($onFulfilled($value));
|
$p->resolve($onFulfilled($value));
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$p->reject($e);
|
$p->reject($e);
|
||||||
} catch (\Exception $e) {
|
|
||||||
$p->reject($e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -50,34 +55,34 @@ class FulfilledPromise implements PromiseInterface
|
|||||||
return $p;
|
return $p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function otherwise(callable $onRejected)
|
public function otherwise(callable $onRejected): PromiseInterface
|
||||||
{
|
{
|
||||||
return $this->then(null, $onRejected);
|
return $this->then(null, $onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wait($unwrap = true, $defaultDelivery = null)
|
public function wait(bool $unwrap = true)
|
||||||
{
|
{
|
||||||
return $unwrap ? $this->value : null;
|
return $unwrap ? $this->value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getState()
|
public function getState(): string
|
||||||
{
|
{
|
||||||
return self::FULFILLED;
|
return self::FULFILLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolve($value)
|
public function resolve($value): void
|
||||||
{
|
{
|
||||||
if ($value !== $this->value) {
|
if ($value !== $this->value) {
|
||||||
throw new \LogicException("Cannot resolve a fulfilled promise");
|
throw new \LogicException('Cannot resolve a fulfilled promise');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reject($reason)
|
public function reject($reason): void
|
||||||
{
|
{
|
||||||
throw new \LogicException("Cannot reject a fulfilled promise");
|
throw new \LogicException('Cannot reject a fulfilled promise');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel(): void
|
||||||
{
|
{
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
final class Is
|
final class Is
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns true if a promise is pending.
|
* Returns true if a promise is pending.
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public static function pending(PromiseInterface $promise)
|
public static function pending(PromiseInterface $promise): bool
|
||||||
{
|
{
|
||||||
return $promise->getState() === PromiseInterface::PENDING;
|
return $promise->getState() === PromiseInterface::PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if a promise is fulfilled or rejected.
|
* Returns true if a promise is fulfilled or rejected.
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public static function settled(PromiseInterface $promise)
|
public static function settled(PromiseInterface $promise): bool
|
||||||
{
|
{
|
||||||
return $promise->getState() !== PromiseInterface::PENDING;
|
return $promise->getState() !== PromiseInterface::PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if a promise is fulfilled.
|
* Returns true if a promise is fulfilled.
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public static function fulfilled(PromiseInterface $promise)
|
public static function fulfilled(PromiseInterface $promise): bool
|
||||||
{
|
{
|
||||||
return $promise->getState() === PromiseInterface::FULFILLED;
|
return $promise->getState() === PromiseInterface::FULFILLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if a promise is rejected.
|
* Returns true if a promise is rejected.
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public static function rejected(PromiseInterface $promise)
|
public static function rejected(PromiseInterface $promise): bool
|
||||||
{
|
{
|
||||||
return $promise->getState() === PromiseInterface::REJECTED;
|
return $promise->getState() === PromiseInterface::REJECTED;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promises/A+ implementation that avoids recursion when possible.
|
* Promises/A+ implementation that avoids recursion when possible.
|
||||||
*
|
*
|
||||||
* @link https://promisesaplus.com/
|
* @see https://promisesaplus.com/
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class Promise implements PromiseInterface
|
class Promise implements PromiseInterface
|
||||||
{
|
{
|
||||||
@@ -31,33 +35,36 @@ class Promise implements PromiseInterface
|
|||||||
public function then(
|
public function then(
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
if ($this->state === self::PENDING) {
|
if ($this->state === self::PENDING) {
|
||||||
$p = new Promise(null, [$this, 'cancel']);
|
$p = new Promise(null, [$this, 'cancel']);
|
||||||
$this->handlers[] = [$p, $onFulfilled, $onRejected];
|
$this->handlers[] = [$p, $onFulfilled, $onRejected];
|
||||||
$p->waitList = $this->waitList;
|
$p->waitList = $this->waitList;
|
||||||
$p->waitList[] = $this;
|
$p->waitList[] = $this;
|
||||||
|
|
||||||
return $p;
|
return $p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a fulfilled promise and immediately invoke any callbacks.
|
// Return a fulfilled promise and immediately invoke any callbacks.
|
||||||
if ($this->state === self::FULFILLED) {
|
if ($this->state === self::FULFILLED) {
|
||||||
$promise = Create::promiseFor($this->result);
|
$promise = Create::promiseFor($this->result);
|
||||||
|
|
||||||
return $onFulfilled ? $promise->then($onFulfilled) : $promise;
|
return $onFulfilled ? $promise->then($onFulfilled) : $promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's either cancelled or rejected, so return a rejected promise
|
// It's either cancelled or rejected, so return a rejected promise
|
||||||
// and immediately invoke any callbacks.
|
// and immediately invoke any callbacks.
|
||||||
$rejection = Create::rejectionFor($this->result);
|
$rejection = Create::rejectionFor($this->result);
|
||||||
|
|
||||||
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
|
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function otherwise(callable $onRejected)
|
public function otherwise(callable $onRejected): PromiseInterface
|
||||||
{
|
{
|
||||||
return $this->then(null, $onRejected);
|
return $this->then(null, $onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wait($unwrap = true)
|
public function wait(bool $unwrap = true)
|
||||||
{
|
{
|
||||||
$this->waitIfPending();
|
$this->waitIfPending();
|
||||||
|
|
||||||
@@ -73,12 +80,12 @@ class Promise implements PromiseInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getState()
|
public function getState(): string
|
||||||
{
|
{
|
||||||
return $this->state;
|
return $this->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel(): void
|
||||||
{
|
{
|
||||||
if ($this->state !== self::PENDING) {
|
if ($this->state !== self::PENDING) {
|
||||||
return;
|
return;
|
||||||
@@ -93,8 +100,6 @@ class Promise implements PromiseInterface
|
|||||||
$fn();
|
$fn();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->reject($e);
|
$this->reject($e);
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->reject($e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,17 +110,17 @@ class Promise implements PromiseInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolve($value)
|
public function resolve($value): void
|
||||||
{
|
{
|
||||||
$this->settle(self::FULFILLED, $value);
|
$this->settle(self::FULFILLED, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reject($reason)
|
public function reject($reason): void
|
||||||
{
|
{
|
||||||
$this->settle(self::REJECTED, $reason);
|
$this->settle(self::REJECTED, $reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function settle($state, $value)
|
private function settle(string $state, $value): void
|
||||||
{
|
{
|
||||||
if ($this->state !== self::PENDING) {
|
if ($this->state !== self::PENDING) {
|
||||||
// Ignore calls with the same resolution.
|
// Ignore calls with the same resolution.
|
||||||
@@ -148,7 +153,7 @@ class Promise implements PromiseInterface
|
|||||||
if (!is_object($value) || !method_exists($value, 'then')) {
|
if (!is_object($value) || !method_exists($value, 'then')) {
|
||||||
$id = $state === self::FULFILLED ? 1 : 2;
|
$id = $state === self::FULFILLED ? 1 : 2;
|
||||||
// It's a success, so resolve the handlers in the queue.
|
// It's a success, so resolve the handlers in the queue.
|
||||||
Utils::queue()->add(static function () use ($id, $value, $handlers) {
|
Utils::queue()->add(static function () use ($id, $value, $handlers): void {
|
||||||
foreach ($handlers as $handler) {
|
foreach ($handlers as $handler) {
|
||||||
self::callHandler($id, $value, $handler);
|
self::callHandler($id, $value, $handler);
|
||||||
}
|
}
|
||||||
@@ -159,12 +164,12 @@ class Promise implements PromiseInterface
|
|||||||
} else {
|
} else {
|
||||||
// Resolve the handlers when the forwarded promise is resolved.
|
// Resolve the handlers when the forwarded promise is resolved.
|
||||||
$value->then(
|
$value->then(
|
||||||
static function ($value) use ($handlers) {
|
static function ($value) use ($handlers): void {
|
||||||
foreach ($handlers as $handler) {
|
foreach ($handlers as $handler) {
|
||||||
self::callHandler(1, $value, $handler);
|
self::callHandler(1, $value, $handler);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
static function ($reason) use ($handlers) {
|
static function ($reason) use ($handlers): void {
|
||||||
foreach ($handlers as $handler) {
|
foreach ($handlers as $handler) {
|
||||||
self::callHandler(2, $reason, $handler);
|
self::callHandler(2, $reason, $handler);
|
||||||
}
|
}
|
||||||
@@ -180,7 +185,7 @@ class Promise implements PromiseInterface
|
|||||||
* @param mixed $value Value to pass to the callback.
|
* @param mixed $value Value to pass to the callback.
|
||||||
* @param array $handler Array of handler data (promise and callbacks).
|
* @param array $handler Array of handler data (promise and callbacks).
|
||||||
*/
|
*/
|
||||||
private static function callHandler($index, $value, array $handler)
|
private static function callHandler(int $index, $value, array $handler): void
|
||||||
{
|
{
|
||||||
/** @var PromiseInterface $promise */
|
/** @var PromiseInterface $promise */
|
||||||
$promise = $handler[0];
|
$promise = $handler[0];
|
||||||
@@ -211,12 +216,10 @@ class Promise implements PromiseInterface
|
|||||||
}
|
}
|
||||||
} catch (\Throwable $reason) {
|
} catch (\Throwable $reason) {
|
||||||
$promise->reject($reason);
|
$promise->reject($reason);
|
||||||
} catch (\Exception $reason) {
|
|
||||||
$promise->reject($reason);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function waitIfPending()
|
private function waitIfPending(): void
|
||||||
{
|
{
|
||||||
if ($this->state !== self::PENDING) {
|
if ($this->state !== self::PENDING) {
|
||||||
return;
|
return;
|
||||||
@@ -227,9 +230,9 @@ class Promise implements PromiseInterface
|
|||||||
} else {
|
} else {
|
||||||
// If there's no wait function, then reject the promise.
|
// If there's no wait function, then reject the promise.
|
||||||
$this->reject('Cannot wait on a promise that has '
|
$this->reject('Cannot wait on a promise that has '
|
||||||
. 'no internal wait function. You must provide a wait '
|
.'no internal wait function. You must provide a wait '
|
||||||
. 'function when constructing the promise to be able to '
|
.'function when constructing the promise to be able to '
|
||||||
. 'wait on a promise.');
|
.'wait on a promise.');
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::queue()->run();
|
Utils::queue()->run();
|
||||||
@@ -240,13 +243,13 @@ class Promise implements PromiseInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function invokeWaitFn()
|
private function invokeWaitFn(): void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$wfn = $this->waitFn;
|
$wfn = $this->waitFn;
|
||||||
$this->waitFn = null;
|
$this->waitFn = null;
|
||||||
$wfn(true);
|
$wfn(true);
|
||||||
} catch (\Exception $reason) {
|
} catch (\Throwable $reason) {
|
||||||
if ($this->state === self::PENDING) {
|
if ($this->state === self::PENDING) {
|
||||||
// The promise has not been resolved yet, so reject the promise
|
// The promise has not been resolved yet, so reject the promise
|
||||||
// with the exception.
|
// with the exception.
|
||||||
@@ -259,7 +262,7 @@ class Promise implements PromiseInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function invokeWaitList()
|
private function invokeWaitList(): void
|
||||||
{
|
{
|
||||||
$waitList = $this->waitList;
|
$waitList = $this->waitList;
|
||||||
$this->waitList = null;
|
$this->waitList = null;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,13 +11,13 @@ namespace GuzzleHttp\Promise;
|
|||||||
* which registers callbacks to receive either a promise’s eventual value or
|
* which registers callbacks to receive either a promise’s eventual value or
|
||||||
* the reason why the promise cannot be fulfilled.
|
* the reason why the promise cannot be fulfilled.
|
||||||
*
|
*
|
||||||
* @link https://promisesaplus.com/
|
* @see https://promisesaplus.com/
|
||||||
*/
|
*/
|
||||||
interface PromiseInterface
|
interface PromiseInterface
|
||||||
{
|
{
|
||||||
const PENDING = 'pending';
|
public const PENDING = 'pending';
|
||||||
const FULFILLED = 'fulfilled';
|
public const FULFILLED = 'fulfilled';
|
||||||
const REJECTED = 'rejected';
|
public const REJECTED = 'rejected';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends fulfillment and rejection handlers to the promise, and returns
|
* Appends fulfillment and rejection handlers to the promise, and returns
|
||||||
@@ -23,13 +25,11 @@ interface PromiseInterface
|
|||||||
*
|
*
|
||||||
* @param callable $onFulfilled Invoked when the promise fulfills.
|
* @param callable $onFulfilled Invoked when the promise fulfills.
|
||||||
* @param callable $onRejected Invoked when the promise is rejected.
|
* @param callable $onRejected Invoked when the promise is rejected.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public function then(
|
public function then(
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
);
|
): PromiseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends a rejection handler callback to the promise, and returns a new
|
* Appends a rejection handler callback to the promise, and returns a new
|
||||||
@@ -38,20 +38,16 @@ interface PromiseInterface
|
|||||||
* fulfilled.
|
* fulfilled.
|
||||||
*
|
*
|
||||||
* @param callable $onRejected Invoked when the promise is rejected.
|
* @param callable $onRejected Invoked when the promise is rejected.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public function otherwise(callable $onRejected);
|
public function otherwise(callable $onRejected): PromiseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the state of the promise ("pending", "rejected", or "fulfilled").
|
* Get the state of the promise ("pending", "rejected", or "fulfilled").
|
||||||
*
|
*
|
||||||
* The three states can be checked against the constants defined on
|
* The three states can be checked against the constants defined on
|
||||||
* PromiseInterface: PENDING, FULFILLED, and REJECTED.
|
* PromiseInterface: PENDING, FULFILLED, and REJECTED.
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getState();
|
public function getState(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve the promise with the given value.
|
* Resolve the promise with the given value.
|
||||||
@@ -60,7 +56,7 @@ interface PromiseInterface
|
|||||||
*
|
*
|
||||||
* @throws \RuntimeException if the promise is already resolved.
|
* @throws \RuntimeException if the promise is already resolved.
|
||||||
*/
|
*/
|
||||||
public function resolve($value);
|
public function resolve($value): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reject the promise with the given reason.
|
* Reject the promise with the given reason.
|
||||||
@@ -69,14 +65,14 @@ interface PromiseInterface
|
|||||||
*
|
*
|
||||||
* @throws \RuntimeException if the promise is already resolved.
|
* @throws \RuntimeException if the promise is already resolved.
|
||||||
*/
|
*/
|
||||||
public function reject($reason);
|
public function reject($reason): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the promise if possible.
|
* Cancels the promise if possible.
|
||||||
*
|
*
|
||||||
* @link https://github.com/promises-aplus/cancellation-spec/issues/7
|
* @see https://github.com/promises-aplus/cancellation-spec/issues/7
|
||||||
*/
|
*/
|
||||||
public function cancel();
|
public function cancel(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits until the promise completes if possible.
|
* Waits until the promise completes if possible.
|
||||||
@@ -86,12 +82,10 @@ interface PromiseInterface
|
|||||||
*
|
*
|
||||||
* If the promise cannot be waited on, then the promise will be rejected.
|
* If the promise cannot be waited on, then the promise will be rejected.
|
||||||
*
|
*
|
||||||
* @param bool $unwrap
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
* @throws \LogicException if the promise has no wait function or if the
|
* @throws \LogicException if the promise has no wait function or if the
|
||||||
* promise does not settle after waiting.
|
* promise does not settle after waiting.
|
||||||
*/
|
*/
|
||||||
public function wait($unwrap = true);
|
public function wait(bool $unwrap = true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,8 +11,6 @@ interface PromisorInterface
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns a promise.
|
* Returns a promise.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public function promise();
|
public function promise(): PromiseInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,11 +9,16 @@ namespace GuzzleHttp\Promise;
|
|||||||
*
|
*
|
||||||
* Thenning off of this promise will invoke the onRejected callback
|
* Thenning off of this promise will invoke the onRejected callback
|
||||||
* immediately and ignore other callbacks.
|
* immediately and ignore other callbacks.
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class RejectedPromise implements PromiseInterface
|
class RejectedPromise implements PromiseInterface
|
||||||
{
|
{
|
||||||
private $reason;
|
private $reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $reason
|
||||||
|
*/
|
||||||
public function __construct($reason)
|
public function __construct($reason)
|
||||||
{
|
{
|
||||||
if (is_object($reason) && method_exists($reason, 'then')) {
|
if (is_object($reason) && method_exists($reason, 'then')) {
|
||||||
@@ -26,7 +33,7 @@ class RejectedPromise implements PromiseInterface
|
|||||||
public function then(
|
public function then(
|
||||||
callable $onFulfilled = null,
|
callable $onFulfilled = null,
|
||||||
callable $onRejected = null
|
callable $onRejected = null
|
||||||
) {
|
): PromiseInterface {
|
||||||
// If there's no onRejected callback then just return self.
|
// If there's no onRejected callback then just return self.
|
||||||
if (!$onRejected) {
|
if (!$onRejected) {
|
||||||
return $this;
|
return $this;
|
||||||
@@ -35,7 +42,7 @@ class RejectedPromise implements PromiseInterface
|
|||||||
$queue = Utils::queue();
|
$queue = Utils::queue();
|
||||||
$reason = $this->reason;
|
$reason = $this->reason;
|
||||||
$p = new Promise([$queue, 'run']);
|
$p = new Promise([$queue, 'run']);
|
||||||
$queue->add(static function () use ($p, $reason, $onRejected) {
|
$queue->add(static function () use ($p, $reason, $onRejected): void {
|
||||||
if (Is::pending($p)) {
|
if (Is::pending($p)) {
|
||||||
try {
|
try {
|
||||||
// Return a resolved promise if onRejected does not throw.
|
// Return a resolved promise if onRejected does not throw.
|
||||||
@@ -43,9 +50,6 @@ class RejectedPromise implements PromiseInterface
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// onRejected threw, so return a rejected promise.
|
// onRejected threw, so return a rejected promise.
|
||||||
$p->reject($e);
|
$p->reject($e);
|
||||||
} catch (\Exception $e) {
|
|
||||||
// onRejected threw, so return a rejected promise.
|
|
||||||
$p->reject($e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -53,12 +57,12 @@ class RejectedPromise implements PromiseInterface
|
|||||||
return $p;
|
return $p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function otherwise(callable $onRejected)
|
public function otherwise(callable $onRejected): PromiseInterface
|
||||||
{
|
{
|
||||||
return $this->then(null, $onRejected);
|
return $this->then(null, $onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wait($unwrap = true, $defaultDelivery = null)
|
public function wait(bool $unwrap = true)
|
||||||
{
|
{
|
||||||
if ($unwrap) {
|
if ($unwrap) {
|
||||||
throw Create::exceptionFor($this->reason);
|
throw Create::exceptionFor($this->reason);
|
||||||
@@ -67,24 +71,24 @@ class RejectedPromise implements PromiseInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getState()
|
public function getState(): string
|
||||||
{
|
{
|
||||||
return self::REJECTED;
|
return self::REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolve($value)
|
public function resolve($value): void
|
||||||
{
|
{
|
||||||
throw new \LogicException("Cannot resolve a rejected promise");
|
throw new \LogicException('Cannot resolve a rejected promise');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reject($reason)
|
public function reject($reason): void
|
||||||
{
|
{
|
||||||
if ($reason !== $this->reason) {
|
if ($reason !== $this->reason) {
|
||||||
throw new \LogicException("Cannot reject a rejected promise");
|
throw new \LogicException('Cannot reject a rejected promise');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel(): void
|
||||||
{
|
{
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,8 +15,8 @@ class RejectionException extends \RuntimeException
|
|||||||
private $reason;
|
private $reason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $reason Rejection reason.
|
* @param mixed $reason Rejection reason.
|
||||||
* @param string $description Optional description
|
* @param string|null $description Optional description.
|
||||||
*/
|
*/
|
||||||
public function __construct($reason, $description = null)
|
public function __construct($reason, $description = null)
|
||||||
{
|
{
|
||||||
@@ -23,14 +25,13 @@ class RejectionException extends \RuntimeException
|
|||||||
$message = 'The promise was rejected';
|
$message = 'The promise was rejected';
|
||||||
|
|
||||||
if ($description) {
|
if ($description) {
|
||||||
$message .= ' with reason: ' . $description;
|
$message .= ' with reason: '.$description;
|
||||||
} elseif (is_string($reason)
|
} elseif (is_string($reason)
|
||||||
|| (is_object($reason) && method_exists($reason, '__toString'))
|
|| (is_object($reason) && method_exists($reason, '__toString'))
|
||||||
) {
|
) {
|
||||||
$message .= ' with reason: ' . $this->reason;
|
$message .= ' with reason: '.$this->reason;
|
||||||
} elseif ($reason instanceof \JsonSerializable) {
|
} elseif ($reason instanceof \JsonSerializable) {
|
||||||
$message .= ' with reason: '
|
$message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT);
|
||||||
. json_encode($this->reason, JSON_PRETTY_PRINT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($message);
|
parent::__construct($message);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,16 +12,18 @@ namespace GuzzleHttp\Promise;
|
|||||||
* by calling the `run()` function of the global task queue in an event loop.
|
* by calling the `run()` function of the global task queue in an event loop.
|
||||||
*
|
*
|
||||||
* GuzzleHttp\Promise\Utils::queue()->run();
|
* GuzzleHttp\Promise\Utils::queue()->run();
|
||||||
|
*
|
||||||
|
* @final
|
||||||
*/
|
*/
|
||||||
class TaskQueue implements TaskQueueInterface
|
class TaskQueue implements TaskQueueInterface
|
||||||
{
|
{
|
||||||
private $enableShutdown = true;
|
private $enableShutdown = true;
|
||||||
private $queue = [];
|
private $queue = [];
|
||||||
|
|
||||||
public function __construct($withShutdown = true)
|
public function __construct(bool $withShutdown = true)
|
||||||
{
|
{
|
||||||
if ($withShutdown) {
|
if ($withShutdown) {
|
||||||
register_shutdown_function(function () {
|
register_shutdown_function(function (): void {
|
||||||
if ($this->enableShutdown) {
|
if ($this->enableShutdown) {
|
||||||
// Only run the tasks if an E_ERROR didn't occur.
|
// Only run the tasks if an E_ERROR didn't occur.
|
||||||
$err = error_get_last();
|
$err = error_get_last();
|
||||||
@@ -31,17 +35,17 @@ class TaskQueue implements TaskQueueInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isEmpty()
|
public function isEmpty(): bool
|
||||||
{
|
{
|
||||||
return !$this->queue;
|
return !$this->queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add(callable $task)
|
public function add(callable $task): void
|
||||||
{
|
{
|
||||||
$this->queue[] = $task;
|
$this->queue[] = $task;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run()
|
public function run(): void
|
||||||
{
|
{
|
||||||
while ($task = array_shift($this->queue)) {
|
while ($task = array_shift($this->queue)) {
|
||||||
/** @var callable $task */
|
/** @var callable $task */
|
||||||
@@ -60,7 +64,7 @@ class TaskQueue implements TaskQueueInterface
|
|||||||
*
|
*
|
||||||
* Note: This shutdown will occur before any destructors are triggered.
|
* Note: This shutdown will occur before any destructors are triggered.
|
||||||
*/
|
*/
|
||||||
public function disableShutdown()
|
public function disableShutdown(): void
|
||||||
{
|
{
|
||||||
$this->enableShutdown = false;
|
$this->enableShutdown = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
interface TaskQueueInterface
|
interface TaskQueueInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns true if the queue is empty.
|
* Returns true if the queue is empty.
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public function isEmpty();
|
public function isEmpty(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a task to the queue that will be executed the next time run is
|
* Adds a task to the queue that will be executed the next time run is
|
||||||
* called.
|
* called.
|
||||||
*/
|
*/
|
||||||
public function add(callable $task);
|
public function add(callable $task): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute all of the pending task in the queue.
|
* Execute all of the pending task in the queue.
|
||||||
*/
|
*/
|
||||||
public function run();
|
public function run(): void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
namespace GuzzleHttp\Promise;
|
||||||
|
|
||||||
final class Utils
|
final class Utils
|
||||||
@@ -17,11 +19,9 @@ final class Utils
|
|||||||
* }
|
* }
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
|
* @param TaskQueueInterface|null $assign Optionally specify a new queue instance.
|
||||||
*
|
|
||||||
* @return TaskQueueInterface
|
|
||||||
*/
|
*/
|
||||||
public static function queue(TaskQueueInterface $assign = null)
|
public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface
|
||||||
{
|
{
|
||||||
static $queue;
|
static $queue;
|
||||||
|
|
||||||
@@ -39,22 +39,18 @@ final class Utils
|
|||||||
* returns a promise that is fulfilled or rejected with the result.
|
* returns a promise that is fulfilled or rejected with the result.
|
||||||
*
|
*
|
||||||
* @param callable $task Task function to run.
|
* @param callable $task Task function to run.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function task(callable $task)
|
public static function task(callable $task): PromiseInterface
|
||||||
{
|
{
|
||||||
$queue = self::queue();
|
$queue = self::queue();
|
||||||
$promise = new Promise([$queue, 'run']);
|
$promise = new Promise([$queue, 'run']);
|
||||||
$queue->add(function () use ($task, $promise) {
|
$queue->add(function () use ($task, $promise): void {
|
||||||
try {
|
try {
|
||||||
if (Is::pending($promise)) {
|
if (Is::pending($promise)) {
|
||||||
$promise->resolve($task());
|
$promise->resolve($task());
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$promise->reject($e);
|
$promise->reject($e);
|
||||||
} catch (\Exception $e) {
|
|
||||||
$promise->reject($e);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,22 +68,18 @@ final class Utils
|
|||||||
* key mapping to the rejection reason of the promise.
|
* key mapping to the rejection reason of the promise.
|
||||||
*
|
*
|
||||||
* @param PromiseInterface $promise Promise or value.
|
* @param PromiseInterface $promise Promise or value.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public static function inspect(PromiseInterface $promise)
|
public static function inspect(PromiseInterface $promise): array
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return [
|
return [
|
||||||
'state' => PromiseInterface::FULFILLED,
|
'state' => PromiseInterface::FULFILLED,
|
||||||
'value' => $promise->wait()
|
'value' => $promise->wait(),
|
||||||
];
|
];
|
||||||
} catch (RejectionException $e) {
|
} catch (RejectionException $e) {
|
||||||
return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
|
return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
|
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
|
||||||
} catch (\Exception $e) {
|
|
||||||
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,14 +92,12 @@ final class Utils
|
|||||||
* @see inspect for the inspection state array format.
|
* @see inspect for the inspection state array format.
|
||||||
*
|
*
|
||||||
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
|
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public static function inspectAll($promises)
|
public static function inspectAll($promises): array
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach ($promises as $key => $promise) {
|
foreach ($promises as $key => $promise) {
|
||||||
$results[$key] = inspect($promise);
|
$results[$key] = self::inspect($promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
@@ -122,12 +112,9 @@ final class Utils
|
|||||||
*
|
*
|
||||||
* @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
|
* @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
|
||||||
*
|
*
|
||||||
* @return array
|
* @throws \Throwable on error
|
||||||
*
|
|
||||||
* @throws \Exception on error
|
|
||||||
* @throws \Throwable on error in PHP >=7
|
|
||||||
*/
|
*/
|
||||||
public static function unwrap($promises)
|
public static function unwrap($promises): array
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach ($promises as $key => $promise) {
|
foreach ($promises as $key => $promise) {
|
||||||
@@ -147,22 +134,21 @@ final class Utils
|
|||||||
*
|
*
|
||||||
* @param mixed $promises Promises or values.
|
* @param mixed $promises Promises or values.
|
||||||
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
|
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function all($promises, $recursive = false)
|
public static function all($promises, bool $recursive = false): PromiseInterface
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
$promise = Each::of(
|
$promise = Each::of(
|
||||||
$promises,
|
$promises,
|
||||||
function ($value, $idx) use (&$results) {
|
function ($value, $idx) use (&$results): void {
|
||||||
$results[$idx] = $value;
|
$results[$idx] = $value;
|
||||||
},
|
},
|
||||||
function ($reason, $idx, Promise $aggregate) {
|
function ($reason, $idx, Promise $aggregate): void {
|
||||||
$aggregate->reject($reason);
|
$aggregate->reject($reason);
|
||||||
}
|
}
|
||||||
)->then(function () use (&$results) {
|
)->then(function () use (&$results) {
|
||||||
ksort($results);
|
ksort($results);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -173,6 +159,7 @@ final class Utils
|
|||||||
return self::all($promises, $recursive);
|
return self::all($promises, $recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -193,17 +180,15 @@ final class Utils
|
|||||||
*
|
*
|
||||||
* @param int $count Total number of promises.
|
* @param int $count Total number of promises.
|
||||||
* @param mixed $promises Promises or values.
|
* @param mixed $promises Promises or values.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function some($count, $promises)
|
public static function some(int $count, $promises): PromiseInterface
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
$rejections = [];
|
$rejections = [];
|
||||||
|
|
||||||
return Each::of(
|
return Each::of(
|
||||||
$promises,
|
$promises,
|
||||||
function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
|
function ($value, $idx, PromiseInterface $p) use (&$results, $count): void {
|
||||||
if (Is::settled($p)) {
|
if (Is::settled($p)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -212,7 +197,7 @@ final class Utils
|
|||||||
$p->resolve(null);
|
$p->resolve(null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function ($reason) use (&$rejections) {
|
function ($reason) use (&$rejections): void {
|
||||||
$rejections[] = $reason;
|
$rejections[] = $reason;
|
||||||
}
|
}
|
||||||
)->then(
|
)->then(
|
||||||
@@ -224,6 +209,7 @@ final class Utils
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
ksort($results);
|
ksort($results);
|
||||||
|
|
||||||
return array_values($results);
|
return array_values($results);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -234,10 +220,8 @@ final class Utils
|
|||||||
* fulfillment value is not an array of 1 but the value directly.
|
* fulfillment value is not an array of 1 but the value directly.
|
||||||
*
|
*
|
||||||
* @param mixed $promises Promises or values.
|
* @param mixed $promises Promises or values.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function any($promises)
|
public static function any($promises): PromiseInterface
|
||||||
{
|
{
|
||||||
return self::some(1, $promises)->then(function ($values) {
|
return self::some(1, $promises)->then(function ($values) {
|
||||||
return $values[0];
|
return $values[0];
|
||||||
@@ -253,23 +237,22 @@ final class Utils
|
|||||||
* @see inspect for the inspection state array format.
|
* @see inspect for the inspection state array format.
|
||||||
*
|
*
|
||||||
* @param mixed $promises Promises or values.
|
* @param mixed $promises Promises or values.
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*/
|
*/
|
||||||
public static function settle($promises)
|
public static function settle($promises): PromiseInterface
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
|
|
||||||
return Each::of(
|
return Each::of(
|
||||||
$promises,
|
$promises,
|
||||||
function ($value, $idx) use (&$results) {
|
function ($value, $idx) use (&$results): void {
|
||||||
$results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
|
$results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
|
||||||
},
|
},
|
||||||
function ($reason, $idx) use (&$results) {
|
function ($reason, $idx) use (&$results): void {
|
||||||
$results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
|
$results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
|
||||||
}
|
}
|
||||||
)->then(function () use (&$results) {
|
)->then(function () use (&$results) {
|
||||||
ksort($results);
|
ksort($results);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,363 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace GuzzleHttp\Promise;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the global task queue used for promise resolution.
|
|
||||||
*
|
|
||||||
* This task queue MUST be run in an event loop in order for promises to be
|
|
||||||
* settled asynchronously. It will be automatically run when synchronously
|
|
||||||
* waiting on a promise.
|
|
||||||
*
|
|
||||||
* <code>
|
|
||||||
* while ($eventLoop->isRunning()) {
|
|
||||||
* GuzzleHttp\Promise\queue()->run();
|
|
||||||
* }
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
|
|
||||||
*
|
|
||||||
* @return TaskQueueInterface
|
|
||||||
*
|
|
||||||
* @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
|
|
||||||
*/
|
|
||||||
function queue(TaskQueueInterface $assign = null)
|
|
||||||
{
|
|
||||||
return Utils::queue($assign);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a function to run in the task queue when it is next `run()` and returns
|
|
||||||
* a promise that is fulfilled or rejected with the result.
|
|
||||||
*
|
|
||||||
* @param callable $task Task function to run.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
|
|
||||||
*/
|
|
||||||
function task(callable $task)
|
|
||||||
{
|
|
||||||
return Utils::task($task);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a promise for a value if the value is not a promise.
|
|
||||||
*
|
|
||||||
* @param mixed $value Promise or value.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
|
|
||||||
*/
|
|
||||||
function promise_for($value)
|
|
||||||
{
|
|
||||||
return Create::promiseFor($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a rejected promise for a reason if the reason is not a promise. If
|
|
||||||
* the provided reason is a promise, then it is returned as-is.
|
|
||||||
*
|
|
||||||
* @param mixed $reason Promise or reason.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
|
|
||||||
*/
|
|
||||||
function rejection_for($reason)
|
|
||||||
{
|
|
||||||
return Create::rejectionFor($reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an exception for a rejected promise value.
|
|
||||||
*
|
|
||||||
* @param mixed $reason
|
|
||||||
*
|
|
||||||
* @return \Exception|\Throwable
|
|
||||||
*
|
|
||||||
* @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
|
|
||||||
*/
|
|
||||||
function exception_for($reason)
|
|
||||||
{
|
|
||||||
return Create::exceptionFor($reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an iterator for the given value.
|
|
||||||
*
|
|
||||||
* @param mixed $value
|
|
||||||
*
|
|
||||||
* @return \Iterator
|
|
||||||
*
|
|
||||||
* @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
|
|
||||||
*/
|
|
||||||
function iter_for($value)
|
|
||||||
{
|
|
||||||
return Create::iterFor($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Synchronously waits on a promise to resolve and returns an inspection state
|
|
||||||
* array.
|
|
||||||
*
|
|
||||||
* Returns a state associative array containing a "state" key mapping to a
|
|
||||||
* valid promise state. If the state of the promise is "fulfilled", the array
|
|
||||||
* will contain a "value" key mapping to the fulfilled value of the promise. If
|
|
||||||
* the promise is rejected, the array will contain a "reason" key mapping to
|
|
||||||
* the rejection reason of the promise.
|
|
||||||
*
|
|
||||||
* @param PromiseInterface $promise Promise or value.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
|
|
||||||
*/
|
|
||||||
function inspect(PromiseInterface $promise)
|
|
||||||
{
|
|
||||||
return Utils::inspect($promise);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Waits on all of the provided promises, but does not unwrap rejected promises
|
|
||||||
* as thrown exception.
|
|
||||||
*
|
|
||||||
* Returns an array of inspection state arrays.
|
|
||||||
*
|
|
||||||
* @see inspect for the inspection state array format.
|
|
||||||
*
|
|
||||||
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
|
|
||||||
*/
|
|
||||||
function inspect_all($promises)
|
|
||||||
{
|
|
||||||
return Utils::inspectAll($promises);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Waits on all of the provided promises and returns the fulfilled values.
|
|
||||||
*
|
|
||||||
* Returns an array that contains the value of each promise (in the same order
|
|
||||||
* the promises were provided). An exception is thrown if any of the promises
|
|
||||||
* are rejected.
|
|
||||||
*
|
|
||||||
* @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @throws \Exception on error
|
|
||||||
* @throws \Throwable on error in PHP >=7
|
|
||||||
*
|
|
||||||
* @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
|
|
||||||
*/
|
|
||||||
function unwrap($promises)
|
|
||||||
{
|
|
||||||
return Utils::unwrap($promises);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given an array of promises, return a promise that is fulfilled when all the
|
|
||||||
* items in the array are fulfilled.
|
|
||||||
*
|
|
||||||
* The promise's fulfillment value is an array with fulfillment values at
|
|
||||||
* respective positions to the original array. If any promise in the array
|
|
||||||
* rejects, the returned promise is rejected with the rejection reason.
|
|
||||||
*
|
|
||||||
* @param mixed $promises Promises or values.
|
|
||||||
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
|
|
||||||
*/
|
|
||||||
function all($promises, $recursive = false)
|
|
||||||
{
|
|
||||||
return Utils::all($promises, $recursive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initiate a competitive race between multiple promises or values (values will
|
|
||||||
* become immediately fulfilled promises).
|
|
||||||
*
|
|
||||||
* When count amount of promises have been fulfilled, the returned promise is
|
|
||||||
* fulfilled with an array that contains the fulfillment values of the winners
|
|
||||||
* in order of resolution.
|
|
||||||
*
|
|
||||||
* This promise is rejected with a {@see AggregateException} if the number of
|
|
||||||
* fulfilled promises is less than the desired $count.
|
|
||||||
*
|
|
||||||
* @param int $count Total number of promises.
|
|
||||||
* @param mixed $promises Promises or values.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
|
|
||||||
*/
|
|
||||||
function some($count, $promises)
|
|
||||||
{
|
|
||||||
return Utils::some($count, $promises);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Like some(), with 1 as count. However, if the promise fulfills, the
|
|
||||||
* fulfillment value is not an array of 1 but the value directly.
|
|
||||||
*
|
|
||||||
* @param mixed $promises Promises or values.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
|
|
||||||
*/
|
|
||||||
function any($promises)
|
|
||||||
{
|
|
||||||
return Utils::any($promises);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a promise that is fulfilled when all of the provided promises have
|
|
||||||
* been fulfilled or rejected.
|
|
||||||
*
|
|
||||||
* The returned promise is fulfilled with an array of inspection state arrays.
|
|
||||||
*
|
|
||||||
* @see inspect for the inspection state array format.
|
|
||||||
*
|
|
||||||
* @param mixed $promises Promises or values.
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
|
|
||||||
*/
|
|
||||||
function settle($promises)
|
|
||||||
{
|
|
||||||
return Utils::settle($promises);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given an iterator that yields promises or values, returns a promise that is
|
|
||||||
* fulfilled with a null value when the iterator has been consumed or the
|
|
||||||
* aggregate promise has been fulfilled or rejected.
|
|
||||||
*
|
|
||||||
* $onFulfilled is a function that accepts the fulfilled value, iterator index,
|
|
||||||
* and the aggregate promise. The callback can invoke any necessary side
|
|
||||||
* effects and choose to resolve or reject the aggregate if needed.
|
|
||||||
*
|
|
||||||
* $onRejected is a function that accepts the rejection reason, iterator index,
|
|
||||||
* and the aggregate promise. The callback can invoke any necessary side
|
|
||||||
* effects and choose to resolve or reject the aggregate if needed.
|
|
||||||
*
|
|
||||||
* @param mixed $iterable Iterator or array to iterate over.
|
|
||||||
* @param callable $onFulfilled
|
|
||||||
* @param callable $onRejected
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
|
|
||||||
*/
|
|
||||||
function each(
|
|
||||||
$iterable,
|
|
||||||
callable $onFulfilled = null,
|
|
||||||
callable $onRejected = null
|
|
||||||
) {
|
|
||||||
return Each::of($iterable, $onFulfilled, $onRejected);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Like each, but only allows a certain number of outstanding promises at any
|
|
||||||
* given time.
|
|
||||||
*
|
|
||||||
* $concurrency may be an integer or a function that accepts the number of
|
|
||||||
* pending promises and returns a numeric concurrency limit value to allow for
|
|
||||||
* dynamic a concurrency size.
|
|
||||||
*
|
|
||||||
* @param mixed $iterable
|
|
||||||
* @param int|callable $concurrency
|
|
||||||
* @param callable $onFulfilled
|
|
||||||
* @param callable $onRejected
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
|
|
||||||
*/
|
|
||||||
function each_limit(
|
|
||||||
$iterable,
|
|
||||||
$concurrency,
|
|
||||||
callable $onFulfilled = null,
|
|
||||||
callable $onRejected = null
|
|
||||||
) {
|
|
||||||
return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Like each_limit, but ensures that no promise in the given $iterable argument
|
|
||||||
* is rejected. If any promise is rejected, then the aggregate promise is
|
|
||||||
* rejected with the encountered rejection.
|
|
||||||
*
|
|
||||||
* @param mixed $iterable
|
|
||||||
* @param int|callable $concurrency
|
|
||||||
* @param callable $onFulfilled
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
|
|
||||||
*/
|
|
||||||
function each_limit_all(
|
|
||||||
$iterable,
|
|
||||||
$concurrency,
|
|
||||||
callable $onFulfilled = null
|
|
||||||
) {
|
|
||||||
return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if a promise is fulfilled.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*
|
|
||||||
* @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
|
|
||||||
*/
|
|
||||||
function is_fulfilled(PromiseInterface $promise)
|
|
||||||
{
|
|
||||||
return Is::fulfilled($promise);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if a promise is rejected.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*
|
|
||||||
* @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
|
|
||||||
*/
|
|
||||||
function is_rejected(PromiseInterface $promise)
|
|
||||||
{
|
|
||||||
return Is::rejected($promise);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if a promise is fulfilled or rejected.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*
|
|
||||||
* @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
|
|
||||||
*/
|
|
||||||
function is_settled(PromiseInterface $promise)
|
|
||||||
{
|
|
||||||
return Is::settled($promise);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new coroutine.
|
|
||||||
*
|
|
||||||
* @see Coroutine
|
|
||||||
*
|
|
||||||
* @return PromiseInterface
|
|
||||||
*
|
|
||||||
* @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
|
|
||||||
*/
|
|
||||||
function coroutine(callable $generatorFn)
|
|
||||||
{
|
|
||||||
return Coroutine::of($generatorFn);
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// Don't redefine the functions if included multiple times.
|
|
||||||
if (!function_exists('GuzzleHttp\Promise\promise_for')) {
|
|
||||||
require __DIR__ . '/functions.php';
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"php": "^7.4 || ^8.0",
|
||||||
|
"friendsofphp/php-cs-fixer": "3.16.0"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"preferred-install": "dist"
|
||||||
|
}
|
||||||
|
}
|
||||||
10
lib/guzzlehttp/promises/vendor-bin/phpstan/composer.json
Normal file
10
lib/guzzlehttp/promises/vendor-bin/phpstan/composer.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"php": "^7.4 || ^8.0",
|
||||||
|
"phpstan/phpstan": "1.10.11",
|
||||||
|
"phpstan/phpstan-deprecation-rules": "1.1.3"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"preferred-install": "dist"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
lib/guzzlehttp/promises/vendor-bin/psalm/composer.json
Normal file
9
lib/guzzlehttp/promises/vendor-bin/psalm/composer.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"php": "^7.4 || ^8.0",
|
||||||
|
"psalm/phar": "5.9.0"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"preferred-install": "dist"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 2.5.0 - 2023-04-17
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Adjusted `psr/http-message` version constraint to `^1.1 || ^2.0`
|
||||||
|
|
||||||
|
## 2.4.5 - 2023-04-17
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec`
|
||||||
|
- Fixed `Message::bodySummary` when `preg_match` fails
|
||||||
|
- Fixed header validation issue
|
||||||
|
|
||||||
|
## 2.4.4 - 2023-03-09
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Removed the need for `AllowDynamicProperties` in `LazyOpenStream`
|
||||||
|
|
||||||
|
## 2.4.3 - 2022-10-26
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))`
|
||||||
|
|
||||||
|
## 2.4.2 - 2022-10-25
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed erroneous behaviour when combining host and relative path
|
||||||
|
|
||||||
|
## 2.4.1 - 2022-08-28
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Rewind body before reading in `Message::bodySummary`
|
||||||
|
|
||||||
## 2.4.0 - 2022-06-20
|
## 2.4.0 - 2022-06-20
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -97,7 +135,7 @@ Identical to the RC release.
|
|||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- PHP < 7.2 support
|
- PHP < 7.2 support
|
||||||
- All functions in the Guzzle\Psr7 namespace
|
- All functions in the `GuzzleHttp\Psr7` namespace
|
||||||
|
|
||||||
## 1.8.1 - 2021-03-21
|
## 1.8.1 - 2021-03-21
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ functionality like query string parsing.
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
composer require guzzlehttp/psr7
|
||||||
|
```
|
||||||
|
|
||||||
# Stream implementation
|
# Stream implementation
|
||||||
|
|
||||||
This package comes with a number of stream implementations and stream
|
This package comes with a number of stream implementations and stream
|
||||||
@@ -245,6 +251,8 @@ class EofCallbackStream implements StreamInterface
|
|||||||
|
|
||||||
private $callback;
|
private $callback;
|
||||||
|
|
||||||
|
private $stream;
|
||||||
|
|
||||||
public function __construct(StreamInterface $stream, callable $cb)
|
public function __construct(StreamInterface $stream, callable $cb)
|
||||||
{
|
{
|
||||||
$this->stream = $stream;
|
$this->stream = $stream;
|
||||||
@@ -380,10 +388,28 @@ of the header. When a parameter does not contain a value, but just
|
|||||||
contains a key, this function will inject a key with a '' string value.
|
contains a key, this function will inject a key with a '' string value.
|
||||||
|
|
||||||
|
|
||||||
## `GuzzleHttp\Psr7\Header::normalize`
|
## `GuzzleHttp\Psr7\Header::splitList`
|
||||||
|
|
||||||
|
`public static function splitList(string|string[] $header): string[]`
|
||||||
|
|
||||||
|
Splits a HTTP header defined to contain a comma-separated list into
|
||||||
|
each individual value:
|
||||||
|
|
||||||
|
```
|
||||||
|
$knownEtags = Header::splitList($request->getHeader('if-none-match'));
|
||||||
|
```
|
||||||
|
|
||||||
|
Example headers include `accept`, `cache-control` and `if-none-match`.
|
||||||
|
|
||||||
|
|
||||||
|
## `GuzzleHttp\Psr7\Header::normalize` (deprecated)
|
||||||
|
|
||||||
`public static function normalize(string|array $header): array`
|
`public static function normalize(string|array $header): array`
|
||||||
|
|
||||||
|
`Header::normalize()` is deprecated in favor of [`Header::splitList()`](README.md#guzzlehttppsr7headersplitlist)
|
||||||
|
which performs the same operation with a cleaned up API and improved
|
||||||
|
documentation.
|
||||||
|
|
||||||
Converts an array of header values that may contain comma separated
|
Converts an array of header values that may contain comma separated
|
||||||
headers into an array of headers with no comma separated values.
|
headers into an array of headers with no comma separated values.
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5 || ^8.0",
|
"php": "^7.2.5 || ^8.0",
|
||||||
"psr/http-factory": "^1.0",
|
"psr/http-factory": "^1.0",
|
||||||
"psr/http-message": "^1.0",
|
"psr/http-message": "^1.1 || ^2.0",
|
||||||
"ralouphie/getallheaders": "^3.0"
|
"ralouphie/getallheaders": "^3.0"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
"psr/http-message-implementation": "1.0"
|
"psr/http-message-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||||
"http-interop/http-factory-tests": "^0.9",
|
"http-interop/http-factory-tests": "^0.9",
|
||||||
"phpunit/phpunit": "^8.5.8 || ^9.3.10"
|
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
||||||
@@ -78,8 +78,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"bamarni-bin": {
|
||||||
"dev-master": "2.4-dev"
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ final class AppendStream implements StreamInterface
|
|||||||
$progressToNext = false;
|
$progressToNext = false;
|
||||||
|
|
||||||
while ($remaining > 0) {
|
while ($remaining > 0) {
|
||||||
|
|
||||||
// Progress to the next stream if needed.
|
// Progress to the next stream if needed.
|
||||||
if ($progressToNext || $this->streams[$this->current]->eof()) {
|
if ($progressToNext || $this->streams[$this->current]->eof()) {
|
||||||
$progressToNext = false;
|
$progressToNext = false;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ final class Header
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Splits a HTTP header defined to contain comma-separated list into
|
* Splits a HTTP header defined to contain a comma-separated list into
|
||||||
* each individual value. Empty values will be removed.
|
* each individual value. Empty values will be removed.
|
||||||
*
|
*
|
||||||
* Example headers include 'accept', 'cache-control' and 'if-none-match'.
|
* Example headers include 'accept', 'cache-control' and 'if-none-match'.
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ use Psr\Http\Message\StreamInterface;
|
|||||||
* Lazily reads or writes to a file that is opened only after an IO operation
|
* Lazily reads or writes to a file that is opened only after an IO operation
|
||||||
* take place on the stream.
|
* take place on the stream.
|
||||||
*/
|
*/
|
||||||
#[\AllowDynamicProperties]
|
|
||||||
final class LazyOpenStream implements StreamInterface
|
final class LazyOpenStream implements StreamInterface
|
||||||
{
|
{
|
||||||
use StreamDecoratorTrait;
|
use StreamDecoratorTrait;
|
||||||
@@ -21,6 +20,11 @@ final class LazyOpenStream implements StreamInterface
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
private $mode;
|
private $mode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var StreamInterface
|
||||||
|
*/
|
||||||
|
private $stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filename File to lazily open
|
* @param string $filename File to lazily open
|
||||||
* @param string $mode fopen mode to use when opening the stream
|
* @param string $mode fopen mode to use when opening the stream
|
||||||
@@ -29,6 +33,10 @@ final class LazyOpenStream implements StreamInterface
|
|||||||
{
|
{
|
||||||
$this->filename = $filename;
|
$this->filename = $filename;
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
|
|
||||||
|
// unsetting the property forces the first access to go through
|
||||||
|
// __get().
|
||||||
|
unset($this->stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ final class Message
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$body->rewind();
|
||||||
$summary = $body->read($truncateAt);
|
$summary = $body->read($truncateAt);
|
||||||
$body->rewind();
|
$body->rewind();
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ final class Message
|
|||||||
|
|
||||||
// Matches any printable character, including unicode characters:
|
// Matches any printable character, including unicode characters:
|
||||||
// letters, marks, numbers, punctuation, spacing, and separators.
|
// letters, marks, numbers, punctuation, spacing, and separators.
|
||||||
if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
|
if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,12 +224,9 @@ trait MessageTrait
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
|
if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
|
||||||
throw new \InvalidArgumentException(
|
throw new \InvalidArgumentException(
|
||||||
sprintf(
|
sprintf('"%s" is not valid header name.', $header)
|
||||||
'"%s" is not valid header name',
|
|
||||||
$header
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,8 +254,10 @@ trait MessageTrait
|
|||||||
// Clients must not send a request with line folding and a server sending folded headers is
|
// Clients must not send a request with line folding and a server sending folded headers is
|
||||||
// likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting
|
// likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting
|
||||||
// folding is not likely to break any legitimate use case.
|
// folding is not likely to break any legitimate use case.
|
||||||
if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) {
|
if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) {
|
||||||
throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value));
|
throw new \InvalidArgumentException(
|
||||||
|
sprintf('"%s" is not valid header value.', $value)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ final class MultipartStream implements StreamInterface
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $elements = [], string $boundary = null)
|
public function __construct(array $elements = [], string $boundary = null)
|
||||||
{
|
{
|
||||||
$this->boundary = $boundary ?: sha1(uniqid('', true));
|
$this->boundary = $boundary ?: bin2hex(random_bytes(20));
|
||||||
$this->stream = $this->createStream($elements);
|
$this->stream = $this->createStream($elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,10 +144,10 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||||||
foreach (array_keys($files['tmp_name']) as $key) {
|
foreach (array_keys($files['tmp_name']) as $key) {
|
||||||
$spec = [
|
$spec = [
|
||||||
'tmp_name' => $files['tmp_name'][$key],
|
'tmp_name' => $files['tmp_name'][$key],
|
||||||
'size' => $files['size'][$key],
|
'size' => $files['size'][$key] ?? null,
|
||||||
'error' => $files['error'][$key],
|
'error' => $files['error'][$key] ?? null,
|
||||||
'name' => $files['name'][$key],
|
'name' => $files['name'][$key] ?? null,
|
||||||
'type' => $files['type'][$key],
|
'type' => $files['type'][$key] ?? null,
|
||||||
];
|
];
|
||||||
$normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
|
$normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,10 +172,14 @@ class Uri implements UriInterface, \JsonSerializable
|
|||||||
$uri .= $scheme . ':';
|
$uri .= $scheme . ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($authority != ''|| $scheme === 'file') {
|
if ($authority != '' || $scheme === 'file') {
|
||||||
$uri .= '//' . $authority;
|
$uri .= '//' . $authority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($authority != '' && $path != '' && $path[0] != '/') {
|
||||||
|
$path = '/' . $path;
|
||||||
|
}
|
||||||
|
|
||||||
$uri .= $path;
|
$uri .= $path;
|
||||||
|
|
||||||
if ($query != '') {
|
if ($query != '') {
|
||||||
@@ -731,8 +735,6 @@ class Uri implements UriInterface, \JsonSerializable
|
|||||||
if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
|
if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
|
||||||
throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon');
|
throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon');
|
||||||
}
|
}
|
||||||
} elseif (isset($this->path[0]) && $this->path[0] !== '/') {
|
|
||||||
throw new MalformedUriException('The path of a URI with an authority must start with a slash "/" or be empty');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst
|
|||||||
|
|
||||||
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||||
|
|
||||||
[psr-url]: http://www.php-fig.org/psr/psr-18
|
[psr-url]: https://www.php-fig.org/psr/psr-18
|
||||||
[package-url]: https://packagist.org/packages/psr/http-client
|
[package-url]: https://packagist.org/packages/psr/http-client
|
||||||
[implementation-url]: https://packagist.org/providers/psr/http-client-implementation
|
[implementation-url]: https://packagist.org/providers/psr/http-client-implementation
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.0 || ^8.0",
|
"php": "^7.0 || ^8.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
2
lib/psr/http-factory/.gitignore
vendored
2
lib/psr/http-factory/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
composer.lock
|
|
||||||
vendor/
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
extends: default
|
|
||||||
reviewers:
|
|
||||||
-
|
|
||||||
name: contributors
|
|
||||||
required: 1
|
|
||||||
teams:
|
|
||||||
- http-factory-contributors
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
HTTP Factories
|
HTTP Factories
|
||||||
==============
|
==============
|
||||||
|
|
||||||
This repository holds all interfaces related to [PSR-17 (HTTP Message Factories)][psr-17].
|
This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url].
|
||||||
Please refer to the specification for a description.
|
|
||||||
|
|
||||||
You can find implementations of the specification by looking for packages providing the
|
Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory.
|
||||||
[psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) virtual package.
|
|
||||||
|
|
||||||
[psr-17]: https://www.php-fig.org/psr/psr-17/
|
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||||
|
|
||||||
|
[psr-url]: https://www.php-fig.org/psr/psr-17/
|
||||||
|
[package-url]: https://packagist.org/packages/psr/http-factory
|
||||||
|
[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation
|
||||||
|
|||||||
@@ -15,12 +15,12 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": ">=7.0.0",
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@@ -10,4 +10,7 @@ interface that describes a HTTP message. See the specification for more details.
|
|||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
We'll certainly need some stuff in here.
|
Before reading the usage guide we recommend reading the PSR-7 interfaces method list:
|
||||||
|
|
||||||
|
* [`PSR-7 Interfaces Method List`](docs/PSR7-Interfaces.md)
|
||||||
|
* [`PSR-7 Usage Guide`](docs/PSR7-Usage.md)
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0"
|
"php": "^7.2 || ^8.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.0.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
130
lib/psr/http-message/docs/PSR7-Interfaces.md
Normal file
130
lib/psr/http-message/docs/PSR7-Interfaces.md
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
# Interfaces
|
||||||
|
|
||||||
|
The purpose of this list is to help in finding the methods when working with PSR-7. This can be considered as a cheatsheet for PSR-7 interfaces.
|
||||||
|
|
||||||
|
The interfaces defined in PSR-7 are the following:
|
||||||
|
|
||||||
|
| Class Name | Description |
|
||||||
|
|---|---|
|
||||||
|
| [Psr\Http\Message\MessageInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagemessageinterface) | Representation of a HTTP message |
|
||||||
|
| [Psr\Http\Message\RequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagerequestinterface) | Representation of an outgoing, client-side request. |
|
||||||
|
| [Psr\Http\Message\ServerRequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageserverrequestinterface) | Representation of an incoming, server-side HTTP request. |
|
||||||
|
| [Psr\Http\Message\ResponseInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageresponseinterface) | Representation of an outgoing, server-side response. |
|
||||||
|
| [Psr\Http\Message\StreamInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagestreaminterface) | Describes a data stream |
|
||||||
|
| [Psr\Http\Message\UriInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuriinterface) | Value object representing a URI. |
|
||||||
|
| [Psr\Http\Message\UploadedFileInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuploadedfileinterface) | Value object representing a file uploaded through an HTTP request. |
|
||||||
|
|
||||||
|
## `Psr\Http\Message\MessageInterface` Methods
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getProtocolVersion()` | Retrieve HTTP protocol version | 1.0 or 1.1 |
|
||||||
|
| `withProtocolVersion($version)` | Returns new message instance with given HTTP protocol version | |
|
||||||
|
| `getHeaders()` | Retrieve all HTTP Headers | [Request Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields), [Response Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields) |
|
||||||
|
| `hasHeader($name)` | Checks if HTTP Header with given name exists | |
|
||||||
|
| `getHeader($name)` | Retrieves a array with the values for a single header | |
|
||||||
|
| `getHeaderLine($name)` | Retrieves a comma-separated string of the values for a single header | |
|
||||||
|
| `withHeader($name, $value)` | Returns new message instance with given HTTP Header | if the header existed in the original instance, replaces the header value from the original message with the value provided when creating the new instance. |
|
||||||
|
| `withAddedHeader($name, $value)` | Returns new message instance with appended value to given header | If header already exists value will be appended, if not a new header will be created |
|
||||||
|
| `withoutHeader($name)` | Removes HTTP Header with given name| |
|
||||||
|
| `getBody()` | Retrieves the HTTP Message Body | Returns object implementing `StreamInterface`|
|
||||||
|
| `withBody(StreamInterface $body)` | Returns new message instance with given HTTP Message Body | |
|
||||||
|
|
||||||
|
|
||||||
|
## `Psr\Http\Message\RequestInterface` Methods
|
||||||
|
|
||||||
|
Same methods as `Psr\Http\Message\MessageInterface` + the following methods:
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getRequestTarget()` | Retrieves the message's request target | origin-form, absolute-form, authority-form, asterisk-form ([RFC7230](https://www.rfc-editor.org/rfc/rfc7230.txt)) |
|
||||||
|
| `withRequestTarget($requestTarget)` | Return a new message instance with the specific request-target | |
|
||||||
|
| `getMethod()` | Retrieves the HTTP method of the request. | GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE (defined in [RFC7231](https://tools.ietf.org/html/rfc7231)), PATCH (defined in [RFC5789](https://tools.ietf.org/html/rfc5789)) |
|
||||||
|
| `withMethod($method)` | Returns a new message instance with the provided HTTP method | |
|
||||||
|
| `getUri()` | Retrieves the URI instance | |
|
||||||
|
| `withUri(UriInterface $uri, $preserveHost = false)` | Returns a new message instance with the provided URI | |
|
||||||
|
|
||||||
|
|
||||||
|
## `Psr\Http\Message\ServerRequestInterface` Methods
|
||||||
|
|
||||||
|
Same methods as `Psr\Http\Message\RequestInterface` + the following methods:
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getServerParams() ` | Retrieve server parameters | Typically derived from `$_SERVER` |
|
||||||
|
| `getCookieParams()` | Retrieves cookies sent by the client to the server. | Typically derived from `$_COOKIES` |
|
||||||
|
| `withCookieParams(array $cookies)` | Returns a new request instance with the specified cookies | |
|
||||||
|
| `withQueryParams(array $query)` | Returns a new request instance with the specified query string arguments | |
|
||||||
|
| `getUploadedFiles()` | Retrieve normalized file upload data | |
|
||||||
|
| `withUploadedFiles(array $uploadedFiles)` | Returns a new request instance with the specified uploaded files | |
|
||||||
|
| `getParsedBody()` | Retrieve any parameters provided in the request body | |
|
||||||
|
| `withParsedBody($data)` | Returns a new request instance with the specified body parameters | |
|
||||||
|
| `getAttributes()` | Retrieve attributes derived from the request | |
|
||||||
|
| `getAttribute($name, $default = null)` | Retrieve a single derived request attribute | |
|
||||||
|
| `withAttribute($name, $value)` | Returns a new request instance with the specified derived request attribute | |
|
||||||
|
| `withoutAttribute($name)` | Returns a new request instance that without the specified derived request attribute | |
|
||||||
|
|
||||||
|
## `Psr\Http\Message\ResponseInterface` Methods:
|
||||||
|
|
||||||
|
Same methods as `Psr\Http\Message\MessageInterface` + the following methods:
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getStatusCode()` | Gets the response status code. | |
|
||||||
|
| `withStatus($code, $reasonPhrase = '')` | Returns a new response instance with the specified status code and, optionally, reason phrase. | |
|
||||||
|
| `getReasonPhrase()` | Gets the response reason phrase associated with the status code. | |
|
||||||
|
|
||||||
|
## `Psr\Http\Message\StreamInterface` Methods
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `__toString()` | Reads all data from the stream into a string, from the beginning to end. | |
|
||||||
|
| `close()` | Closes the stream and any underlying resources. | |
|
||||||
|
| `detach()` | Separates any underlying resources from the stream. | |
|
||||||
|
| `getSize()` | Get the size of the stream if known. | |
|
||||||
|
| `eof()` | Returns true if the stream is at the end of the stream.| |
|
||||||
|
| `isSeekable()` | Returns whether or not the stream is seekable. | |
|
||||||
|
| `seek($offset, $whence = SEEK_SET)` | Seek to a position in the stream. | |
|
||||||
|
| `rewind()` | Seek to the beginning of the stream. | |
|
||||||
|
| `isWritable()` | Returns whether or not the stream is writable. | |
|
||||||
|
| `write($string)` | Write data to the stream. | |
|
||||||
|
| `isReadable()` | Returns whether or not the stream is readable. | |
|
||||||
|
| `read($length)` | Read data from the stream. | |
|
||||||
|
| `getContents()` | Returns the remaining contents in a string | |
|
||||||
|
| `getMetadata($key = null)()` | Get stream metadata as an associative array or retrieve a specific key. | |
|
||||||
|
|
||||||
|
## `Psr\Http\Message\UriInterface` Methods
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getScheme()` | Retrieve the scheme component of the URI. | |
|
||||||
|
| `getAuthority()` | Retrieve the authority component of the URI. | |
|
||||||
|
| `getUserInfo()` | Retrieve the user information component of the URI. | |
|
||||||
|
| `getHost()` | Retrieve the host component of the URI. | |
|
||||||
|
| `getPort()` | Retrieve the port component of the URI. | |
|
||||||
|
| `getPath()` | Retrieve the path component of the URI. | |
|
||||||
|
| `getQuery()` | Retrieve the query string of the URI. | |
|
||||||
|
| `getFragment()` | Retrieve the fragment component of the URI. | |
|
||||||
|
| `withScheme($scheme)` | Return an instance with the specified scheme. | |
|
||||||
|
| `withUserInfo($user, $password = null)` | Return an instance with the specified user information. | |
|
||||||
|
| `withHost($host)` | Return an instance with the specified host. | |
|
||||||
|
| `withPort($port)` | Return an instance with the specified port. | |
|
||||||
|
| `withPath($path)` | Return an instance with the specified path. | |
|
||||||
|
| `withQuery($query)` | Return an instance with the specified query string. | |
|
||||||
|
| `withFragment($fragment)` | Return an instance with the specified URI fragment. | |
|
||||||
|
| `__toString()` | Return the string representation as a URI reference. | |
|
||||||
|
|
||||||
|
## `Psr\Http\Message\UploadedFileInterface` Methods
|
||||||
|
|
||||||
|
| Method Name | Description | Notes |
|
||||||
|
|------------------------------------| ----------- | ----- |
|
||||||
|
| `getStream()` | Retrieve a stream representing the uploaded file. | |
|
||||||
|
| `moveTo($targetPath)` | Move the uploaded file to a new location. | |
|
||||||
|
| `getSize()` | Retrieve the file size. | |
|
||||||
|
| `getError()` | Retrieve the error associated with the uploaded file. | |
|
||||||
|
| `getClientFilename()` | Retrieve the filename sent by the client. | |
|
||||||
|
| `getClientMediaType()` | Retrieve the media type sent by the client. | |
|
||||||
|
|
||||||
|
> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`.
|
||||||
|
> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered.
|
||||||
|
|
||||||
159
lib/psr/http-message/docs/PSR7-Usage.md
Normal file
159
lib/psr/http-message/docs/PSR7-Usage.md
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
### PSR-7 Usage
|
||||||
|
|
||||||
|
All PSR-7 applications comply with these interfaces
|
||||||
|
They were created to establish a standard between middleware implementations.
|
||||||
|
|
||||||
|
> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`.
|
||||||
|
> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered.
|
||||||
|
|
||||||
|
|
||||||
|
The following examples will illustrate how basic operations are done in PSR-7.
|
||||||
|
|
||||||
|
##### Examples
|
||||||
|
|
||||||
|
|
||||||
|
For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc)
|
||||||
|
All PSR-7 implementations should have the same behaviour.
|
||||||
|
|
||||||
|
The following will be assumed:
|
||||||
|
`$request` is an object of `Psr\Http\Message\RequestInterface` and
|
||||||
|
|
||||||
|
`$response` is an object implementing `Psr\Http\Message\RequestInterface`
|
||||||
|
|
||||||
|
|
||||||
|
### Working with HTTP Headers
|
||||||
|
|
||||||
|
#### Adding headers to response:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$response->withHeader('My-Custom-Header', 'My Custom Message');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Appending values to headers
|
||||||
|
|
||||||
|
```php
|
||||||
|
$response->withAddedHeader('My-Custom-Header', 'The second message');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Checking if header exists:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$request->hasHeader('My-Custom-Header'); // will return false
|
||||||
|
$response->hasHeader('My-Custom-Header'); // will return true
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: My-Custom-Header was only added in the Response
|
||||||
|
|
||||||
|
#### Getting comma-separated values from a header (also applies to request)
|
||||||
|
|
||||||
|
```php
|
||||||
|
// getting value from request headers
|
||||||
|
$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8"
|
||||||
|
// getting value from response headers
|
||||||
|
$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Getting array of value from a header (also applies to request)
|
||||||
|
```php
|
||||||
|
// getting value from request headers
|
||||||
|
$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"]
|
||||||
|
// getting value from response headers
|
||||||
|
$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"]
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Removing headers from HTTP Messages
|
||||||
|
```php
|
||||||
|
// removing a header from Request, removing deprecated "Content-MD5" header
|
||||||
|
$request->withoutHeader('Content-MD5');
|
||||||
|
|
||||||
|
// removing a header from Response
|
||||||
|
// effect: the browser won't know the size of the stream
|
||||||
|
// the browser will download the stream till it ends
|
||||||
|
$response->withoutHeader('Content-Length');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Working with HTTP Message Body
|
||||||
|
|
||||||
|
When working with the PSR-7 there are two methods of implementation:
|
||||||
|
#### 1. Getting the body separately
|
||||||
|
|
||||||
|
> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented.
|
||||||
|
|
||||||
|
```php
|
||||||
|
$body = $response->getBody();
|
||||||
|
// operations on body, eg. read, write, seek
|
||||||
|
// ...
|
||||||
|
// replacing the old body
|
||||||
|
$response->withBody($body);
|
||||||
|
// this last statement is optional as we working with objects
|
||||||
|
// in this case the "new" body is same with the "old" one
|
||||||
|
// the $body variable has the same value as the one in $request, only the reference is passed
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. Working directly on response
|
||||||
|
|
||||||
|
> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required
|
||||||
|
|
||||||
|
```php
|
||||||
|
$response->getBody()->write('hello');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Getting the body contents
|
||||||
|
|
||||||
|
The following snippet gets the contents of a stream contents.
|
||||||
|
> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream.
|
||||||
|
```php
|
||||||
|
$body = $response->getBody();
|
||||||
|
$body->rewind(); // or $body->seek(0);
|
||||||
|
$bodyText = $body->getContents();
|
||||||
|
```
|
||||||
|
> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended.
|
||||||
|
|
||||||
|
### Append to body
|
||||||
|
|
||||||
|
```php
|
||||||
|
$response->getBody()->write('Hello'); // writing directly
|
||||||
|
$body = $request->getBody(); // which is a `StreamInterface`
|
||||||
|
$body->write('xxxxx');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prepend to body
|
||||||
|
Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended.
|
||||||
|
The following example will explain the behaviour of streams.
|
||||||
|
|
||||||
|
```php
|
||||||
|
// assuming our response is initially empty
|
||||||
|
$body = $repsonse->getBody();
|
||||||
|
// writing the string "abcd"
|
||||||
|
$body->write('abcd');
|
||||||
|
|
||||||
|
// seeking to start of stream
|
||||||
|
$body->seek(0);
|
||||||
|
// writing 'ef'
|
||||||
|
$body->write('ef'); // at this point the stream contains "efcd"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Prepending by rewriting separately
|
||||||
|
|
||||||
|
```php
|
||||||
|
// assuming our response body stream only contains: "abcd"
|
||||||
|
$body = $response->getBody();
|
||||||
|
$body->rewind();
|
||||||
|
$contents = $body->getContents(); // abcd
|
||||||
|
// seeking the stream to beginning
|
||||||
|
$body->rewind();
|
||||||
|
$body->write('ef'); // stream contains "efcd"
|
||||||
|
$body->write($contents); // stream contains "efabcd"
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`.
|
||||||
|
|
||||||
|
#### Prepending by using contents as a string
|
||||||
|
```php
|
||||||
|
$body = $response->getBody();
|
||||||
|
$body->rewind();
|
||||||
|
$contents = $body->getContents(); // efabcd
|
||||||
|
$contents = 'ef'.$contents;
|
||||||
|
$body->rewind();
|
||||||
|
$body->write($contents);
|
||||||
|
```
|
||||||
@@ -23,7 +23,7 @@ interface MessageInterface
|
|||||||
*
|
*
|
||||||
* @return string HTTP protocol version.
|
* @return string HTTP protocol version.
|
||||||
*/
|
*/
|
||||||
public function getProtocolVersion();
|
public function getProtocolVersion(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified HTTP protocol version.
|
* Return an instance with the specified HTTP protocol version.
|
||||||
@@ -38,7 +38,7 @@ interface MessageInterface
|
|||||||
* @param string $version HTTP protocol version
|
* @param string $version HTTP protocol version
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withProtocolVersion($version);
|
public function withProtocolVersion(string $version): MessageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves all message header values.
|
* Retrieves all message header values.
|
||||||
@@ -65,7 +65,7 @@ interface MessageInterface
|
|||||||
* key MUST be a header name, and each value MUST be an array of strings
|
* key MUST be a header name, and each value MUST be an array of strings
|
||||||
* for that header.
|
* for that header.
|
||||||
*/
|
*/
|
||||||
public function getHeaders();
|
public function getHeaders(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a header exists by the given case-insensitive name.
|
* Checks if a header exists by the given case-insensitive name.
|
||||||
@@ -75,7 +75,7 @@ interface MessageInterface
|
|||||||
* name using a case-insensitive string comparison. Returns false if
|
* name using a case-insensitive string comparison. Returns false if
|
||||||
* no matching header name is found in the message.
|
* no matching header name is found in the message.
|
||||||
*/
|
*/
|
||||||
public function hasHeader($name);
|
public function hasHeader(string $name): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a message header value by the given case-insensitive name.
|
* Retrieves a message header value by the given case-insensitive name.
|
||||||
@@ -91,7 +91,7 @@ interface MessageInterface
|
|||||||
* header. If the header does not appear in the message, this method MUST
|
* header. If the header does not appear in the message, this method MUST
|
||||||
* return an empty array.
|
* return an empty array.
|
||||||
*/
|
*/
|
||||||
public function getHeader($name);
|
public function getHeader(string $name): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a comma-separated string of the values for a single header.
|
* Retrieves a comma-separated string of the values for a single header.
|
||||||
@@ -112,7 +112,7 @@ interface MessageInterface
|
|||||||
* concatenated together using a comma. If the header does not appear in
|
* concatenated together using a comma. If the header does not appear in
|
||||||
* the message, this method MUST return an empty string.
|
* the message, this method MUST return an empty string.
|
||||||
*/
|
*/
|
||||||
public function getHeaderLine($name);
|
public function getHeaderLine(string $name): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the provided value replacing the specified header.
|
* Return an instance with the provided value replacing the specified header.
|
||||||
@@ -129,7 +129,7 @@ interface MessageInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException for invalid header names or values.
|
* @throws \InvalidArgumentException for invalid header names or values.
|
||||||
*/
|
*/
|
||||||
public function withHeader($name, $value);
|
public function withHeader(string $name, $value): MessageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified header appended with the given value.
|
* Return an instance with the specified header appended with the given value.
|
||||||
@@ -147,7 +147,7 @@ interface MessageInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException for invalid header names or values.
|
* @throws \InvalidArgumentException for invalid header names or values.
|
||||||
*/
|
*/
|
||||||
public function withAddedHeader($name, $value);
|
public function withAddedHeader(string $name, $value): MessageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance without the specified header.
|
* Return an instance without the specified header.
|
||||||
@@ -161,14 +161,14 @@ interface MessageInterface
|
|||||||
* @param string $name Case-insensitive header field name to remove.
|
* @param string $name Case-insensitive header field name to remove.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withoutHeader($name);
|
public function withoutHeader(string $name): MessageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the body of the message.
|
* Gets the body of the message.
|
||||||
*
|
*
|
||||||
* @return StreamInterface Returns the body as a stream.
|
* @return StreamInterface Returns the body as a stream.
|
||||||
*/
|
*/
|
||||||
public function getBody();
|
public function getBody(): StreamInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified message body.
|
* Return an instance with the specified message body.
|
||||||
@@ -183,5 +183,5 @@ interface MessageInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException When the body is not valid.
|
* @throws \InvalidArgumentException When the body is not valid.
|
||||||
*/
|
*/
|
||||||
public function withBody(StreamInterface $body);
|
public function withBody(StreamInterface $body): MessageInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ interface RequestInterface extends MessageInterface
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getRequestTarget();
|
public function getRequestTarget(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specific request-target.
|
* Return an instance with the specific request-target.
|
||||||
@@ -55,17 +55,18 @@ interface RequestInterface extends MessageInterface
|
|||||||
*
|
*
|
||||||
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
|
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
|
||||||
* request-target forms allowed in request messages)
|
* request-target forms allowed in request messages)
|
||||||
* @param mixed $requestTarget
|
* @param string $requestTarget
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withRequestTarget($requestTarget);
|
public function withRequestTarget(string $requestTarget): RequestInterface;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the HTTP method of the request.
|
* Retrieves the HTTP method of the request.
|
||||||
*
|
*
|
||||||
* @return string Returns the request method.
|
* @return string Returns the request method.
|
||||||
*/
|
*/
|
||||||
public function getMethod();
|
public function getMethod(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the provided HTTP method.
|
* Return an instance with the provided HTTP method.
|
||||||
@@ -82,7 +83,7 @@ interface RequestInterface extends MessageInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException for invalid HTTP methods.
|
* @throws \InvalidArgumentException for invalid HTTP methods.
|
||||||
*/
|
*/
|
||||||
public function withMethod($method);
|
public function withMethod(string $method): RequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the URI instance.
|
* Retrieves the URI instance.
|
||||||
@@ -93,7 +94,7 @@ interface RequestInterface extends MessageInterface
|
|||||||
* @return UriInterface Returns a UriInterface instance
|
* @return UriInterface Returns a UriInterface instance
|
||||||
* representing the URI of the request.
|
* representing the URI of the request.
|
||||||
*/
|
*/
|
||||||
public function getUri();
|
public function getUri(): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an instance with the provided URI.
|
* Returns an instance with the provided URI.
|
||||||
@@ -125,5 +126,5 @@ interface RequestInterface extends MessageInterface
|
|||||||
* @param bool $preserveHost Preserve the original state of the Host header.
|
* @param bool $preserveHost Preserve the original state of the Host header.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withUri(UriInterface $uri, $preserveHost = false);
|
public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ interface ResponseInterface extends MessageInterface
|
|||||||
*
|
*
|
||||||
* @return int Status code.
|
* @return int Status code.
|
||||||
*/
|
*/
|
||||||
public function getStatusCode();
|
public function getStatusCode(): int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified status code and, optionally, reason phrase.
|
* Return an instance with the specified status code and, optionally, reason phrase.
|
||||||
@@ -49,7 +49,7 @@ interface ResponseInterface extends MessageInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException For invalid status code arguments.
|
* @throws \InvalidArgumentException For invalid status code arguments.
|
||||||
*/
|
*/
|
||||||
public function withStatus($code, $reasonPhrase = '');
|
public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the response reason phrase associated with the status code.
|
* Gets the response reason phrase associated with the status code.
|
||||||
@@ -64,5 +64,5 @@ interface ResponseInterface extends MessageInterface
|
|||||||
* @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
|
* @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
|
||||||
* @return string Reason phrase; must return an empty string if none present.
|
* @return string Reason phrase; must return an empty string if none present.
|
||||||
*/
|
*/
|
||||||
public function getReasonPhrase();
|
public function getReasonPhrase(): string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getServerParams();
|
public function getServerParams(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve cookies.
|
* Retrieve cookies.
|
||||||
@@ -63,7 +63,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getCookieParams();
|
public function getCookieParams(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified cookies.
|
* Return an instance with the specified cookies.
|
||||||
@@ -82,7 +82,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @param array $cookies Array of key/value pairs representing cookies.
|
* @param array $cookies Array of key/value pairs representing cookies.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withCookieParams(array $cookies);
|
public function withCookieParams(array $cookies): ServerRequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve query string arguments.
|
* Retrieve query string arguments.
|
||||||
@@ -96,7 +96,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQueryParams();
|
public function getQueryParams(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified query string arguments.
|
* Return an instance with the specified query string arguments.
|
||||||
@@ -120,7 +120,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* $_GET.
|
* $_GET.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withQueryParams(array $query);
|
public function withQueryParams(array $query): ServerRequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve normalized file upload data.
|
* Retrieve normalized file upload data.
|
||||||
@@ -134,7 +134,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @return array An array tree of UploadedFileInterface instances; an empty
|
* @return array An array tree of UploadedFileInterface instances; an empty
|
||||||
* array MUST be returned if no data is present.
|
* array MUST be returned if no data is present.
|
||||||
*/
|
*/
|
||||||
public function getUploadedFiles();
|
public function getUploadedFiles(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance with the specified uploaded files.
|
* Create a new instance with the specified uploaded files.
|
||||||
@@ -147,7 +147,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @return static
|
* @return static
|
||||||
* @throws \InvalidArgumentException if an invalid structure is provided.
|
* @throws \InvalidArgumentException if an invalid structure is provided.
|
||||||
*/
|
*/
|
||||||
public function withUploadedFiles(array $uploadedFiles);
|
public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve any parameters provided in the request body.
|
* Retrieve any parameters provided in the request body.
|
||||||
@@ -194,7 +194,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @throws \InvalidArgumentException if an unsupported argument type is
|
* @throws \InvalidArgumentException if an unsupported argument type is
|
||||||
* provided.
|
* provided.
|
||||||
*/
|
*/
|
||||||
public function withParsedBody($data);
|
public function withParsedBody($data): ServerRequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve attributes derived from the request.
|
* Retrieve attributes derived from the request.
|
||||||
@@ -207,7 +207,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
*
|
*
|
||||||
* @return array Attributes derived from the request.
|
* @return array Attributes derived from the request.
|
||||||
*/
|
*/
|
||||||
public function getAttributes();
|
public function getAttributes(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve a single derived request attribute.
|
* Retrieve a single derived request attribute.
|
||||||
@@ -224,7 +224,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @param mixed $default Default value to return if the attribute does not exist.
|
* @param mixed $default Default value to return if the attribute does not exist.
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getAttribute($name, $default = null);
|
public function getAttribute(string $name, $default = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified derived request attribute.
|
* Return an instance with the specified derived request attribute.
|
||||||
@@ -241,7 +241,7 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @param mixed $value The value of the attribute.
|
* @param mixed $value The value of the attribute.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withAttribute($name, $value);
|
public function withAttribute(string $name, $value): ServerRequestInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance that removes the specified derived request attribute.
|
* Return an instance that removes the specified derived request attribute.
|
||||||
@@ -257,5 +257,5 @@ interface ServerRequestInterface extends RequestInterface
|
|||||||
* @param string $name The attribute name.
|
* @param string $name The attribute name.
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withoutAttribute($name);
|
public function withoutAttribute(string $name): ServerRequestInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ interface StreamInterface
|
|||||||
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
|
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function __toString();
|
public function __toString(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the stream and any underlying resources.
|
* Closes the stream and any underlying resources.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function close();
|
public function close(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separates any underlying resources from the stream.
|
* Separates any underlying resources from the stream.
|
||||||
@@ -48,7 +48,7 @@ interface StreamInterface
|
|||||||
*
|
*
|
||||||
* @return int|null Returns the size in bytes if known, or null if unknown.
|
* @return int|null Returns the size in bytes if known, or null if unknown.
|
||||||
*/
|
*/
|
||||||
public function getSize();
|
public function getSize(): ?int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current position of the file read/write pointer
|
* Returns the current position of the file read/write pointer
|
||||||
@@ -56,21 +56,21 @@ interface StreamInterface
|
|||||||
* @return int Position of the file pointer
|
* @return int Position of the file pointer
|
||||||
* @throws \RuntimeException on error.
|
* @throws \RuntimeException on error.
|
||||||
*/
|
*/
|
||||||
public function tell();
|
public function tell(): int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the stream is at the end of the stream.
|
* Returns true if the stream is at the end of the stream.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function eof();
|
public function eof(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the stream is seekable.
|
* Returns whether or not the stream is seekable.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isSeekable();
|
public function isSeekable(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Seek to a position in the stream.
|
* Seek to a position in the stream.
|
||||||
@@ -84,7 +84,7 @@ interface StreamInterface
|
|||||||
* SEEK_END: Set position to end-of-stream plus offset.
|
* SEEK_END: Set position to end-of-stream plus offset.
|
||||||
* @throws \RuntimeException on failure.
|
* @throws \RuntimeException on failure.
|
||||||
*/
|
*/
|
||||||
public function seek($offset, $whence = SEEK_SET);
|
public function seek(int $offset, int $whence = SEEK_SET): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Seek to the beginning of the stream.
|
* Seek to the beginning of the stream.
|
||||||
@@ -96,14 +96,14 @@ interface StreamInterface
|
|||||||
* @link http://www.php.net/manual/en/function.fseek.php
|
* @link http://www.php.net/manual/en/function.fseek.php
|
||||||
* @throws \RuntimeException on failure.
|
* @throws \RuntimeException on failure.
|
||||||
*/
|
*/
|
||||||
public function rewind();
|
public function rewind(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the stream is writable.
|
* Returns whether or not the stream is writable.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isWritable();
|
public function isWritable(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write data to the stream.
|
* Write data to the stream.
|
||||||
@@ -112,14 +112,14 @@ interface StreamInterface
|
|||||||
* @return int Returns the number of bytes written to the stream.
|
* @return int Returns the number of bytes written to the stream.
|
||||||
* @throws \RuntimeException on failure.
|
* @throws \RuntimeException on failure.
|
||||||
*/
|
*/
|
||||||
public function write($string);
|
public function write(string $string): int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the stream is readable.
|
* Returns whether or not the stream is readable.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isReadable();
|
public function isReadable(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read data from the stream.
|
* Read data from the stream.
|
||||||
@@ -131,7 +131,7 @@ interface StreamInterface
|
|||||||
* if no bytes are available.
|
* if no bytes are available.
|
||||||
* @throws \RuntimeException if an error occurs.
|
* @throws \RuntimeException if an error occurs.
|
||||||
*/
|
*/
|
||||||
public function read($length);
|
public function read(int $length): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the remaining contents in a string
|
* Returns the remaining contents in a string
|
||||||
@@ -140,7 +140,7 @@ interface StreamInterface
|
|||||||
* @throws \RuntimeException if unable to read or an error occurs while
|
* @throws \RuntimeException if unable to read or an error occurs while
|
||||||
* reading.
|
* reading.
|
||||||
*/
|
*/
|
||||||
public function getContents();
|
public function getContents(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get stream metadata as an associative array or retrieve a specific key.
|
* Get stream metadata as an associative array or retrieve a specific key.
|
||||||
@@ -149,10 +149,10 @@ interface StreamInterface
|
|||||||
* stream_get_meta_data() function.
|
* stream_get_meta_data() function.
|
||||||
*
|
*
|
||||||
* @link http://php.net/manual/en/function.stream-get-meta-data.php
|
* @link http://php.net/manual/en/function.stream-get-meta-data.php
|
||||||
* @param string $key Specific metadata to retrieve.
|
* @param string|null $key Specific metadata to retrieve.
|
||||||
* @return array|mixed|null Returns an associative array if no key is
|
* @return array|mixed|null Returns an associative array if no key is
|
||||||
* provided. Returns a specific key value if a key is provided and the
|
* provided. Returns a specific key value if a key is provided and the
|
||||||
* value is found, or null if the key is not found.
|
* value is found, or null if the key is not found.
|
||||||
*/
|
*/
|
||||||
public function getMetadata($key = null);
|
public function getMetadata(?string $key = null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ interface UploadedFileInterface
|
|||||||
* @throws \RuntimeException in cases when no stream is available or can be
|
* @throws \RuntimeException in cases when no stream is available or can be
|
||||||
* created.
|
* created.
|
||||||
*/
|
*/
|
||||||
public function getStream();
|
public function getStream(): StreamInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the uploaded file to a new location.
|
* Move the uploaded file to a new location.
|
||||||
@@ -62,7 +62,7 @@ interface UploadedFileInterface
|
|||||||
* @throws \RuntimeException on any error during the move operation, or on
|
* @throws \RuntimeException on any error during the move operation, or on
|
||||||
* the second or subsequent call to the method.
|
* the second or subsequent call to the method.
|
||||||
*/
|
*/
|
||||||
public function moveTo($targetPath);
|
public function moveTo(string $targetPath): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the file size.
|
* Retrieve the file size.
|
||||||
@@ -73,7 +73,7 @@ interface UploadedFileInterface
|
|||||||
*
|
*
|
||||||
* @return int|null The file size in bytes or null if unknown.
|
* @return int|null The file size in bytes or null if unknown.
|
||||||
*/
|
*/
|
||||||
public function getSize();
|
public function getSize(): ?int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the error associated with the uploaded file.
|
* Retrieve the error associated with the uploaded file.
|
||||||
@@ -89,7 +89,7 @@ interface UploadedFileInterface
|
|||||||
* @see http://php.net/manual/en/features.file-upload.errors.php
|
* @see http://php.net/manual/en/features.file-upload.errors.php
|
||||||
* @return int One of PHP's UPLOAD_ERR_XXX constants.
|
* @return int One of PHP's UPLOAD_ERR_XXX constants.
|
||||||
*/
|
*/
|
||||||
public function getError();
|
public function getError(): int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the filename sent by the client.
|
* Retrieve the filename sent by the client.
|
||||||
@@ -104,7 +104,7 @@ interface UploadedFileInterface
|
|||||||
* @return string|null The filename sent by the client or null if none
|
* @return string|null The filename sent by the client or null if none
|
||||||
* was provided.
|
* was provided.
|
||||||
*/
|
*/
|
||||||
public function getClientFilename();
|
public function getClientFilename(): ?string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the media type sent by the client.
|
* Retrieve the media type sent by the client.
|
||||||
@@ -119,5 +119,5 @@ interface UploadedFileInterface
|
|||||||
* @return string|null The media type sent by the client or null if none
|
* @return string|null The media type sent by the client or null if none
|
||||||
* was provided.
|
* was provided.
|
||||||
*/
|
*/
|
||||||
public function getClientMediaType();
|
public function getClientMediaType(): ?string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Http\Message;
|
namespace Psr\Http\Message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +38,7 @@ interface UriInterface
|
|||||||
* @see https://tools.ietf.org/html/rfc3986#section-3.1
|
* @see https://tools.ietf.org/html/rfc3986#section-3.1
|
||||||
* @return string The URI scheme.
|
* @return string The URI scheme.
|
||||||
*/
|
*/
|
||||||
public function getScheme();
|
public function getScheme(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the authority component of the URI.
|
* Retrieve the authority component of the URI.
|
||||||
@@ -57,7 +58,7 @@ interface UriInterface
|
|||||||
* @see https://tools.ietf.org/html/rfc3986#section-3.2
|
* @see https://tools.ietf.org/html/rfc3986#section-3.2
|
||||||
* @return string The URI authority, in "[user-info@]host[:port]" format.
|
* @return string The URI authority, in "[user-info@]host[:port]" format.
|
||||||
*/
|
*/
|
||||||
public function getAuthority();
|
public function getAuthority(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the user information component of the URI.
|
* Retrieve the user information component of the URI.
|
||||||
@@ -74,7 +75,7 @@ interface UriInterface
|
|||||||
*
|
*
|
||||||
* @return string The URI user information, in "username[:password]" format.
|
* @return string The URI user information, in "username[:password]" format.
|
||||||
*/
|
*/
|
||||||
public function getUserInfo();
|
public function getUserInfo(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the host component of the URI.
|
* Retrieve the host component of the URI.
|
||||||
@@ -87,7 +88,7 @@ interface UriInterface
|
|||||||
* @see http://tools.ietf.org/html/rfc3986#section-3.2.2
|
* @see http://tools.ietf.org/html/rfc3986#section-3.2.2
|
||||||
* @return string The URI host.
|
* @return string The URI host.
|
||||||
*/
|
*/
|
||||||
public function getHost();
|
public function getHost(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the port component of the URI.
|
* Retrieve the port component of the URI.
|
||||||
@@ -104,7 +105,7 @@ interface UriInterface
|
|||||||
*
|
*
|
||||||
* @return null|int The URI port.
|
* @return null|int The URI port.
|
||||||
*/
|
*/
|
||||||
public function getPort();
|
public function getPort(): ?int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the path component of the URI.
|
* Retrieve the path component of the URI.
|
||||||
@@ -131,7 +132,7 @@ interface UriInterface
|
|||||||
* @see https://tools.ietf.org/html/rfc3986#section-3.3
|
* @see https://tools.ietf.org/html/rfc3986#section-3.3
|
||||||
* @return string The URI path.
|
* @return string The URI path.
|
||||||
*/
|
*/
|
||||||
public function getPath();
|
public function getPath(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the query string of the URI.
|
* Retrieve the query string of the URI.
|
||||||
@@ -153,7 +154,7 @@ interface UriInterface
|
|||||||
* @see https://tools.ietf.org/html/rfc3986#section-3.4
|
* @see https://tools.ietf.org/html/rfc3986#section-3.4
|
||||||
* @return string The URI query string.
|
* @return string The URI query string.
|
||||||
*/
|
*/
|
||||||
public function getQuery();
|
public function getQuery(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the fragment component of the URI.
|
* Retrieve the fragment component of the URI.
|
||||||
@@ -171,7 +172,7 @@ interface UriInterface
|
|||||||
* @see https://tools.ietf.org/html/rfc3986#section-3.5
|
* @see https://tools.ietf.org/html/rfc3986#section-3.5
|
||||||
* @return string The URI fragment.
|
* @return string The URI fragment.
|
||||||
*/
|
*/
|
||||||
public function getFragment();
|
public function getFragment(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified scheme.
|
* Return an instance with the specified scheme.
|
||||||
@@ -188,7 +189,7 @@ interface UriInterface
|
|||||||
* @return static A new instance with the specified scheme.
|
* @return static A new instance with the specified scheme.
|
||||||
* @throws \InvalidArgumentException for invalid or unsupported schemes.
|
* @throws \InvalidArgumentException for invalid or unsupported schemes.
|
||||||
*/
|
*/
|
||||||
public function withScheme($scheme);
|
public function withScheme(string $scheme): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified user information.
|
* Return an instance with the specified user information.
|
||||||
@@ -204,7 +205,7 @@ interface UriInterface
|
|||||||
* @param null|string $password The password associated with $user.
|
* @param null|string $password The password associated with $user.
|
||||||
* @return static A new instance with the specified user information.
|
* @return static A new instance with the specified user information.
|
||||||
*/
|
*/
|
||||||
public function withUserInfo($user, $password = null);
|
public function withUserInfo(string $user, ?string $password = null): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified host.
|
* Return an instance with the specified host.
|
||||||
@@ -218,7 +219,7 @@ interface UriInterface
|
|||||||
* @return static A new instance with the specified host.
|
* @return static A new instance with the specified host.
|
||||||
* @throws \InvalidArgumentException for invalid hostnames.
|
* @throws \InvalidArgumentException for invalid hostnames.
|
||||||
*/
|
*/
|
||||||
public function withHost($host);
|
public function withHost(string $host): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified port.
|
* Return an instance with the specified port.
|
||||||
@@ -237,7 +238,7 @@ interface UriInterface
|
|||||||
* @return static A new instance with the specified port.
|
* @return static A new instance with the specified port.
|
||||||
* @throws \InvalidArgumentException for invalid ports.
|
* @throws \InvalidArgumentException for invalid ports.
|
||||||
*/
|
*/
|
||||||
public function withPort($port);
|
public function withPort(?int $port): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified path.
|
* Return an instance with the specified path.
|
||||||
@@ -261,7 +262,7 @@ interface UriInterface
|
|||||||
* @return static A new instance with the specified path.
|
* @return static A new instance with the specified path.
|
||||||
* @throws \InvalidArgumentException for invalid paths.
|
* @throws \InvalidArgumentException for invalid paths.
|
||||||
*/
|
*/
|
||||||
public function withPath($path);
|
public function withPath(string $path): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified query string.
|
* Return an instance with the specified query string.
|
||||||
@@ -278,7 +279,7 @@ interface UriInterface
|
|||||||
* @return static A new instance with the specified query string.
|
* @return static A new instance with the specified query string.
|
||||||
* @throws \InvalidArgumentException for invalid query strings.
|
* @throws \InvalidArgumentException for invalid query strings.
|
||||||
*/
|
*/
|
||||||
public function withQuery($query);
|
public function withQuery(string $query): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an instance with the specified URI fragment.
|
* Return an instance with the specified URI fragment.
|
||||||
@@ -294,7 +295,7 @@ interface UriInterface
|
|||||||
* @param string $fragment The fragment to use with the new instance.
|
* @param string $fragment The fragment to use with the new instance.
|
||||||
* @return static A new instance with the specified fragment.
|
* @return static A new instance with the specified fragment.
|
||||||
*/
|
*/
|
||||||
public function withFragment($fragment);
|
public function withFragment(string $fragment): UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the string representation as a URI reference.
|
* Return the string representation as a URI reference.
|
||||||
@@ -319,5 +320,5 @@ interface UriInterface
|
|||||||
* @see http://tools.ietf.org/html/rfc3986#section-4.1
|
* @see http://tools.ietf.org/html/rfc3986#section-4.1
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function __toString();
|
public function __toString(): string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user