hollodotme/fast-cgi-client
A PHP fast CGI client to send requests (a)synchronously to PHP-FPM.
v3.1.7
28M downloads/mo
#700 most downloaded on Packagist
hollodotme/fast-cgi-client
What this package is like to depend on
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 10 months
Most releases are documented
notes for 25 of 32 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
34 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
34 releases · Jan 2017 to Dec 2021Releases
latest 34-
v3.1.707 Dec 2021Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file. This project adheres
to Semantic Versioning and Keep a CHANGELOG.3.1.7 - 2021-12-07
- Make sure length values are within valid bounds
3.1.6 - 2021-09-23
Added
- PHP 8.1 comaptibility
3.1.5 - 2020-12-10
Fixed
- Transfer of multipart/form-data blocks - #64
- Removes base64 encoding for contents of files to transfer
- Removes
Content-Transfer-Encoding: base64header from multipart block for files - Improves determination of file's MIME type via
mime_content_type(), if available - Adds tests for multipart transfer of files with binary content (images)
3.1.4 - 2020-11-23
Added
- PHP 8.1 compatibility
- Makefile to run all tests based on docker-compose config
Fixed
- TypeError on PHP 8 for a resource that is neither
nullnor aresource - Added ext-xdebug as dev-requirement in composer.json
- Xdebug 3 coverage filter constant name for PHP 8
Replaced
- Local shell script to run tests with Makefile
Removed
- CI Builds on Circle-CI
3.1.3 - 2020-08-13
Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - #61
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any
accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON
data. This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request
content type composers. - For more information and examples have a look at the documentation
section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below in the changelog
of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseData
andClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intrespectively in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each
request (which it is not). Also the first constructor parameter of theResponseclass was removed with this change. -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>
toClient#getSocketIdsHavingResponse() : array<int>in order to reflect the correct semantics of the returned array
of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced
withResponse#getOutput(). The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given
key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : array
andResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour
ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent
infinite tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking)
change was necessary and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR. This refers mainly to the
errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See
an example in the documentation
for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in
interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter
ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single
response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the
respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective
response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the
respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the
respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call
the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response
directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM
pool-children-scalability) - Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of
interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of
interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETE
inhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based
on Pierrick Charron's PHP-FastCGI-Client:Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the
socket connection) - Method
Client->getValues()
-
v3.1.623 Sep 2021Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file. This project adheres
to Semantic Versioning and Keep a CHANGELOG.3.1.6 - 2021-09-23
Added
- PHP 8.1 comaptibility
3.1.5 - 2020-12-10
Fixed
- Transfer of multipart/form-data blocks - #64
- Removes base64 encoding for contents of files to transfer
- Removes
Content-Transfer-Encoding: base64header from multipart block for files - Improves determination of file's MIME type via
mime_content_type(), if available - Adds tests for multipart transfer of files with binary content (images)
3.1.4 - 2020-11-23
Added
- PHP 8.1 compatibility
- Makefile to run all tests based on docker-compose config
Fixed
- TypeError on PHP 8 for a resource that is neither
nullnor aresource - Added ext-xdebug as dev-requirement in composer.json
- Xdebug 3 coverage filter constant name for PHP 8
Replaced
- Local shell script to run tests with Makefile
Removed
- CI Builds on Circle-CI
3.1.3 - 2020-08-13
Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - #61
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any
accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON
data. This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request
content type composers. - For more information and examples have a look at the documentation
section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below in the changelog
of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseData
andClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intrespectively in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each
request (which it is not). Also the first constructor parameter of theResponseclass was removed with this change. -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>
toClient#getSocketIdsHavingResponse() : array<int>in order to reflect the correct semantics of the returned array
of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced
withResponse#getOutput(). The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given
key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : array
andResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour
ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent
infinite tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking)
change was necessary and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR. This refers mainly to the
errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See
an example in the documentation
for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in
interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter
ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single
response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the
respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective
response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the
respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the
respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call
the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response
directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM
pool-children-scalability) - Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of
interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of
interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETE
inhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based
on Pierrick Charron's PHP-FastCGI-Client:Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the
socket connection) - Method
Client->getValues()
-
v3.1.510 Dec 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file. This project adheres
to Semantic Versioning and Keep a CHANGELOG.3.1.5 - 2020-12-10
Fixed
- Transfer of multipart/form-data blocks - #64
- Removes base64 encoding for contents of files to transfer
- Removes
Content-Transfer-Encoding: base64header from multipart block for files - Improves determination of file's MIME type via
mime_content_type(), if available - Adds tests for multipart transfer of files with binary content (images)
3.1.4 - 2020-11-23
Added
- PHP 8 compatibility
- Makefile to run all tests based on docker-compose config
Fixed
- TypeError on PHP 8 for a resource that is neither
nullnor aresource - Added ext-xdebug as dev-requirement in composer.json
- Xdebug 3 coverage filter constant name for PHP 8
Replaced
- Local shell script to run tests with Makefile
Removed
- CI Builds on Circle-CI
3.1.3 - 2020-08-13
Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - #61
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intrespectively in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed with this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Fixed
- Transfer of multipart/form-data blocks - [#64]
- Removes base64 encoding for contents of files to transfer
- Removes
Content-Transfer-Encoding: base64header from multipart block for files - Improves determination of file's MIME type via
mime_content_type(), if available - Adds tests for multipart transfer of files with binary content (images)
- Transfer of multipart/form-data blocks - #64
-
v3.1.423 Nov 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file. This project adheres
to Semantic Versioning and Keep a CHANGELOG.3.1.4 - 2020-11-23
Added
- PHP 8 compatibility
- Makefile to run all tests based on docker-compose config
Fixed
- TypeError on PHP 8 for a resource that is neither
nullnor aresource - Added ext-xdebug as dev-requirement in composer.json
- Xdebug 3 coverage filter constant name for PHP 8
Replaced
- Local shell script to run tests with Makefile
Removed
- CI Builds on Circle-CI
3.1.3 - 2020-08-13
Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - #61
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intrespectively in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed with this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Added
- PHP 8.1 compatibility
- Makefile to run all tests based on docker-compose config
Fixed
- TypeError on PHP 8 for a resource that is neither
nullnor aresource - Added ext-xdebug as dev-requirement in composer.json
- Xdebug 3 coverage filter constant name for PHP 8
Replaced
- Local shell script to run tests with Makefile
Removed
- CI Builds on Circle-CI
-
v3.1.313 Aug 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning and Keep a CHANGELOG.3.1.3 - 2020-08-13
Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - #61
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intresepctivly in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed wiht this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Fixed
- Remove broken sockets from socket collection if writing the request to stream fails - [#61]
- Do not export
docker-compose.ymlwith composer archives via.gitattributes - Stabilize unreliable tests with signaled pool processes
-
v3.1.219 May 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning and Keep a CHANGELOG.3.1.2 - 2020-05-19
Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - #58
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any accessible fastCGI endpoint and may be exposed in some setups)
3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intresepctivly in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed wiht this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Added
.gitattributesfile to exclude non-relevant files/directories from archives/releases installed by composer - [#58]
Fixed
- Remove link to
bin/fcgigetincomposer.jsonas it is a potential security issue (becausebin/fcgigetaccepts any accessible fastCGI endpoint and may be exposed in some setups)
-
v3.1.106 May 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning and Keep a CHANGELOG.3.1.1 - 2020-05-06
Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - #56
See also: #55
3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - #53 - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intresepctivly in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed wiht this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Fixed
- Backwards compatibility break in userland classes extending
AbstractRequestdue to a final constructor. - [#56] See also: [#55]
- Backwards compatibility break in userland classes extending
-
v3.1.006 May 2020Release notes
Open source →CHANGELOG
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning and Keep a CHANGELOG.3.1.0 - 2020-05-06
Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
This was inspired by - [53] - Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
3.0.1 - 2019-10-24
Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - #51
3.0.0 - 2019-07-29
Please take notice of the backwards incompatible changes (BC breaks) documented below
in the changelog of 3.0.0-alpha & 3.0.0-beta.Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
3.0.0-beta - 2019-06-24
Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - #45 -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intresepctivly in order
to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not).
Also the first constructor parameter of theResponseclass was removed wiht this change. - #39 -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - #39 -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect
the correct semantics of the returned array of IDs. - #39
3.0.0-alpha - 2019-04-30
Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support
multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ]
-
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given
header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ]
-
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput().
The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - #35 - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - #35
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - #36
2.7.2 - 2019-05-31
Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - #41
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm'spm.max_childrensetting. - #40
2.7.1 - 2019-04-29
Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite
tries/re-use of those failed connections. - #37
2.7.0 - 2019-04-28
Added
- Re-using of idle sockets for successive requests - #33
2.6.0 - 2019-04-02
Added
-
Two new methods to Response class - #27
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from
theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - #27$callback = function( string $outputBuffer, string $errorBuffer ) {};
This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- #27
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- #27
Please read this blog post why this (BC breaking) change was necessary
and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
2.5.0 - 2019-01-29
Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR.
This refers mainly to the errorPrimary script unknownresp. the responseFile not found.. -
CI builds for PHP 7.3
2.4.3 - 2018-09-17
Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as
recommended in the official PHP documentation. - #20
2.4.2 - 2018-01-28
Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - #15
2.4.1 - 2017-11-19
Fixes
- PHP warning when trying to get ready request IDs - #14
Improves
- Loop performance
2.4.0 - 2017-09-28
Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - #11
See an example in the documentation for further informaiton.
2.3.0 - 2017-06-15
Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- #9 - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - #9 - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - #9
2.2.0 - 2017-04-15
Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation - #6 - Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - #5 - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
2.1.0 - 2017-03-07
Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- #5 - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- #2
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- #5 - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- #5 - Abstract request class for implementing individual request methods, contains all request default values - #5
- Request implementations: - #5
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - #2
2.0.1 - 2017-02-23
Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - #1
Changed
- Testsuite updated for PHPUnit >= 6
2.0.0 - 2017-01-03
Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
1.0.0 - 2017-01-03
Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Added
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data. This was inspired by - [#53]
- Named constructor
newWithRequestContentto all request classes in order to simplify the use of the new request content type composers. - For more information and examples have a look at the documentation section "Request contents".
Fixed
- Inspection issues found by PHPStan
Updated
- Test suites to cover PHP versions from 7.1 to 7.4
- License dates
- CI moved to GitHub actions
- Interface for request content composers with implementations for URL encoded form-data, multipart form-data and JSON data.
-
v3.0.124 Oct 2019Release notes
Open source →Added
- PHP 7.4 CI pipeline and docker-compose environment
- Explicitly set
error_reporting=-1for CI and tests in order to capture deprecation warnings
Fixed
- Replace usage of curly brace syntax for accessing string offsets, which is deprecated in PHP 7.4 - [#51]
-
v3.0.029 Jul 2019Release notes
Open source →Please take notice of the backwards incompatible changes (BC breaks) documented below in the changelog of 3.0.0-alpha & 3.0.0-beta.
Added
- Reserved private constant for ABORT_REQUEST instruction for future use
- Socket ID is now represented and generated by a proper type class
Improved
- Import of root namespace functions
- Dependency injection for socket implementation
-
v3.0.0-beta24 Jun 2019 pre-releaseRelease notes
Open source →Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - [#45] -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intrespectively in order to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not). Also the first constructor parameter of theResponseclass was removed with this change.- [#39]
-
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - [#39] -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect the correct semantics of the returned array of IDs. - [#39]
Release notes
Open source →Backwards incompatible changes (BC breaks)
-
The socket conection parameter was moved from the
Client's constructor toClient#sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : ProvidesResponseDataandClient#sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request) : int
in order to allow sending (equal) requests to different FastCGI servers using the same
Clientinstance. - [#45] -
Removed method
ProvidesResponseData#getRequestId() : intandResponse#getRequestId() : intresepctivly in order to avoid confusion about the semantics of the term "request ID" and misusage by assuming it is a unique ID for each request (which it is not). Also the first constructor parameter of theResponseclass was removed wiht this change. - [#39] -
Renamed all
$requestId(s)parameters to$socketId(s)in order to reflect the correct semantics of the ID. - [#39] -
Renamed method
Client#getRequestIdsHavingResponse() : array<int>toClient#getSocketIdsHavingResponse() : array<int>in order to reflect the correct semantics of the returned array of IDs. - [#39]
-
-
v3.0.0-alpha29 Apr 2019 pre-releaseRelease notes
Open source →Backwards incompatible changes (BC breaks)
-
Method
Response#getHeaders() : arraywill now return a two-dimensional array with grouped values to support multi-value headers. Previous versions returned a one-dimensional key-value array.# Previous versions [ 'Status' => 'HTTP/2 200 OK', 'Set-Cookie' => 'tasty_cookie=strawberry', ] # Since 3.0.0-alpha [ 'Status' => [ 'HTTP/2 200 OK', ], 'Set-Cookie' => [ 'yummy_cookie=choco', 'tasty_cookie=strawberry', ], ] -
Method
Response#getHeader(string $headerKey) : arraywill now return an array containing all values for the given header key to support multi-value headers. Previous versions returned the last value as a string.echo $response->getHeader('Set-Cookie'); # Previous versions 'tasty_cookie=strawberry' # Since 3.0.0-alpha [ 'yummy_cookie=choco', 'tasty_cookie=strawberry' ] -
Method
Response#getRawResponse() : stringis no longer available and its usage must be replaced withResponse#getOutput(). The method was deprecated since version 2.6.0.
Added
- Method
Response#getHeaderLine(string $headerKey) : stringthat returns all values, separated by comma, for the given key. - [#35] - Header keys are now case-insensitive in
Response#getHeader(string $headerKey) : arrayandResponse#getHeaderLine(string $headerKey) : string. - [#35]
Removed
- Method
Response#getRawResponse() : stringthat was deprecated in version 2.6.0 in favour ofResponse#getOutput() : string. - [#36]
-
-
v2.7.230 May 2019Release notes
Open source →Improved
- Handling of
stream_selectreturningfalsein case of a system call interrupt. - [#41]
Fixed
- Remove/close sockets after fetching their responses triggered async requests in order to prevent halt on further
request processing, if the number of requests exceeds php-fpm's
pm.max_childrensetting. - [#40]
- Handling of
-
v2.7.129 Apr 2019Release notes
Open source →Fixed
- Remove failed sockets from internal collection that errored out during reading of response in order to prevent infinite tries/re-use of those failed connections. - [#37]
-
v2.7.028 Apr 2019 -
v2.6.002 Apr 2019Release notes
Open source →Added
-
Two new methods to Response class - [#27]
Response#getOutput()which is identical toResponse#getRawResponse()and will return the complete output from theSTDOUTstream of the response.Response#getError()which will return the complete output of theSTDERRstream of the response.
-
Second parameter
$errorBufferin tha pass through callback signature - [#27]$callback = function( string $outputBuffer, string $errorBuffer ) {};This parameter will contain the contents of the
STDERRstream packets.
Deprecated
Response#getRawResponse()in favour of consistant naming. This method will be removed inv3.0.0- [#27]
Removed
ProcessManagerExceptionthat was introduced inv2.5.0- [#27] Please read this blog post why this (BC breaking) change was necessary and how to handle server-sent errors now.
Fixed
bin/fcgigetto accept full URL paths and print STDOUT and STDERR output
Improved
- Documentation
-
-
v2.5.028 Jan 2019Release notes
Open source →Added
-
New
ProcessManagerExceptionin case the php-fpm responds with packages of typeSTDERR. This refers mainly to the errorPrimary script unknownresp. the responseFile not found..- [#26]
-
CI builds for PHP 7.3
-
-
v2.4.317 Sep 2018Release notes
Open source →Fixes
- Value of Client::STREAM_SELECT_USEC was to low with
20000and was updated to200000as recommended in the official PHP documentation. - [#20]
- Value of Client::STREAM_SELECT_USEC was to low with
-
v2.4.228 Jan 2018Release notes
Open source →Fixes
- Missing data in
php://inputon worker side when client sends content larger than 65535 bytes - [#15]
- Missing data in
-
v2.4.118 Nov 2017Release notes
Open source →Fixes
- PHP warning when trying to get ready request IDs - [#14]
Improves
- Loop performance
-
v2.4.028 Sep 2017Release notes
Open source →Added
- Ability to add pass through callbacks in order to access output buffer from a long running callee - [#11]
See an example in the documentation for further informaiton.
- Ability to add pass through callbacks in order to access output buffer from a long running callee - [#11]
-
v2.3.015 Jun 2017Release notes
Open source →Changed
- Replaced methods
getHost()andgetPort()withgetSocketAddress()in interfacehollodotme\FastCGI\Interfaces\ConfiguresSocketConnection- [#9] - The transport protocol
unix://must be omitted for the first parameter ofhollodotme\FastCGI\SocketConnections\UnixDomainSocket
Only the socket path must be passed. - [#9] - Replaced
fsockopen()withstream_socket_client()for connecting to php-fpm. - [#9]
- Replaced methods
-
v2.2.015 Apr 2017Release notes
Open source →Added
- Method
addResponseCallbacks(callable ...$callbacks)to all request classes to enable response evaluation delegation- [#6]
- Method
addFailureCallbacks(callable ...$callbacks)to all request classes to enable exception handling delegation - Method
readResponse(int $requestId, ?int $timeoutMs = null) : ProvidesResponseDatato read and retrieve a single response - Method
readResponses(?int $imeoutMs = null, int ...$requestIds) : \Generatorto read and yield multiple responses - Method
readReadyResponses(?int $imeoutMs = null) : \Generatorto check for ready responses, read and yield them - Method
waitForResponses(?int $timeout = null)toClientclass for waiting for multiple responses and calling the respective response callbacks - [#5] - Method
getRequestIdsHavingResponse() : arrayto enable reactive read of responses as they occur - Method
hasUnhandledResponses() : boolto check for outstanding responses - Method
handleResponse(int $requestId, ?int $timeoutMs = null)to fetch a specific response and notify the respective response callback - Method
handleResponses(?int $timeoutMs = null, int ...$requestIds)to fetch a specific responses and notify the respective response callbacks - Method
handleReadyResponses(?int $timeoutMs = null)to check for ready responses, fetch them and notify the respective response callbacks
Changed
- Method
waitForResponse(int $requestId, ?int $timeoutMs = null)is not returning a response anymore, but will call the response callback
UsereadResponse(int $requestId, ?int $timeoutMs = null): ProvidesResponseDataif you want to get the response directly.
Removed
- Optional flag to make a connection persistent (is now always disabled in favour of better timeout handling and FPM pool-children-scalability)
- Optional flag to keep the server-side connection alive (is now always enabled, affects only network sockets)
Improved
- Code coverage by automated integration tests
- Timeout handling on multiple requests
- Method
-
v2.1.007 Mar 2017Release notes
Open source →Changed
- Methods
sendRequestandsendAsyncRequestexpect to get an object of interfacehollodotme\FastCGI\Interfaces\ProvidesRequestData- [#5] - Methods
sendRequestandwaitForResponsenow return an object of interfacehollodotme\FastCGI\Interfaces\ProvidesResponseData- [#2]
Added
- Public class constants for request methods
GET,POST,PUT,PATCHandDELETEinhollodotme\FastCGI\Constants\RequestMethod- [#5] - Public class constants for server protocols
HTTP/1.0andHTTP/1.1inhollodotme\FastCGI\Constants\ServerProtocol- [#5]
- Abstract request class for implementing individual request methods, contains all request default values - [#5]
- Request implementations: - [#5]
hollodotme\FastCGI\Requests\GetRequesthollodotme\FastCGI\Requests\PostRequesthollodotme\FastCGI\Requests\PutRequesthollodotme\FastCGI\Requests\PatchRequesthollodotme\FastCGI\Requests\DeleteRequest
- Response implementation - [#2]
- Methods
-
v2.0.123 Feb 2017Release notes
Open source →Fixed
- Erroneous response returned by Client::sendRequest() and Client::waitForResponse() - [#1]
Changed
- Testsuite updated for PHPUnit >= 6
-
v2.0.003 Jan 2017Release notes
Open source →Changed
- Class constant visibility to private in class
Client - Class constant visibility to privare in class
Encoders\PacketEncoder - Class constant visibility to public in class
SocketConnections\Defaults - Composer requires php >= 7.1
- Class constant visibility to private in class
-
v1.4.228 Jan 2018Nothing published for this version
-
v1.4.118 Nov 2017Nothing published for this version
-
v1.4.028 Sep 2017Nothing published for this version
-
v1.3.015 Jun 2017Nothing published for this version
-
v1.2.027 May 2017Nothing published for this version
-
v1.1.007 Mar 2017Nothing published for this version
-
v1.0.123 Feb 2017Nothing published for this version
-
v1.0.003 Jan 2017Release notes
Open source →Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
Release notes
Open source →Based on Pierrick Charron's PHP-FastCGI-Client:
Added
- Socket connection interface
ConfiguresSocketConnection - Socket connection classes
UnixDomainSocketandNetworkSocket - Base exception
FastCGIClientException - Derived exceptions
ForbiddenException,ReadFailedException,TimeoutException,WriteFailedException
Changed
- Constructor of
Clientnow expects aConfiguresSocketConnectioninstance - Renamed
Client->request()toClient->sendRequest() - Renamed
Client->async_request()toClient->sendAsyncRequest() - Renamed
Client->wait_for_response()toClient->waitForResponse()
Removed
- Unused class constants from
Client - Getters/Setters for connect timeout, read/write timeout, keep alive, socket persistence from
Client(now part of the socket connection) - Method
Client->getValues()
- Socket connection interface