Changelog 3.x
All notable changes of the 3.x releases are documented in this file. This project adheres to Semantic Versioning and Keep a CHANGELOG.
For other major versions see: latest, 2.x, 1.x
3.1.8 - 2026-10-05
Backport of fixes from version 4.0.0.
Fixed
Client#waitForResponse()andClient#waitForResponses()did not return, if the server did not respond, even if a timeout was passed. If a timeout is passed, the failure callbacks of the request are notified with aTimedoutExceptionafter it now. Without a timeout, they still wait until the response is received.- A socket that could not connect stayed in the collection of the client.
- Endless loop when the connection was closed before a packet was received completely, e.g. when the process
handling the request was terminated while it sent its response, or when the client was connected to a HTTP server
instead of a FastCGI server. A
ReadFailedExceptionis thrown now. - Reading a response that was not completed by the server timed out after twice the read/write timeout.
- Packet headers are read completely before they are decoded, also if they arrive in several parts.
NameValuePairEncoder#decodePairs()decoded names and values of 16 MiB and more with a wrong length.- The first two lines of a response were lost, if it did not start with a header.
- Headers and body of a response are separated independently of the line endings of the platform the client runs on.
- Request parameters longer than 65535 bytes in total corrupted the request, because the length of a record was cut
to 2 bytes. They are sent in multiple records now, split between name-value pairs.
PacketEncoder#encodePacket()splits content that is longer than one record into consecutive records of the same type. - Request content
"0"was not sent. - A request that could only be written partly, e.g. because the server did not read it before the read/write timeout,
was treated as sent. A
TimedoutExceptionorWriteFailedExceptionis thrown now. - A read timeout passed to
readResponse()and the other methods reading responses applied to writing the next request on the same socket as well. The read/write timeout of the connection applies again. - An idle socket was reported as having a response, when the server closed its connection. Its response was then
returned again by
readReadyResponses(), and its callbacks were notified again byhandleReadyResponses()andwaitForResponses(). Client#hasResponse()andClient#waitForResponse()checked the stream of a socket whose response was already read withreadResponse(). Such a socket has its response now.- A response without any packet was returned as an empty response, if the socket had no stream anymore.
Client#getSocketIdsHavingResponse()and the methods based on it could throw aValueErroron PHP 8, if the sockets of the client had no stream, e.g. after a failed connect.- A partly written request waited for the read/write timeout twice before a
TimedoutExceptionwas thrown. - An end-request record without protocol status caused an "Uninitialized string offset" notice and was treated as
a completed request. A
ReadFailedExceptionis thrown now.
Changed
These changes of the behaviour are fixes, but you may notice them:
- A timeout passed to
Client#waitForResponse()andClient#waitForResponses()ends the waiting. The failure callbacks of requests without response are notified with aTimedoutExceptionthen. Without a timeout, both methods wait until the responses are received, as before. Client#hasResponse()returnstruefor a socket whose response was already read withreadResponse(). Before, it returnedfalseuntil the server closed the connection, andtrueafterwards.Client#getSocketIdsHavingResponse(),readReadyResponses()andhandleReadyResponses()only consider sockets that wait for a response. Idle sockets are not reported anymore.- Exceptions are thrown in situations that hung, returned an empty response or treated a request as sent before:
a connection closed while the response is received or a HTTP server instead of a FastCGI server
(
ReadFailedException), a response that is not completed within the read/write timeout (TimedoutException), a partly written request (TimedoutExceptionorWriteFailedException) and an end-request record without protocol status (ReadFailedException). PacketEncoder#encodePacket()returns several records for content that is longer than 65535 bytes, instead of one record with a wrong length.- Output that consists of header lines without a blank line after them is the body of the response now, without headers. The headers of a response are separated from its body by a blank line, which php-fpm always sends.
- The CI uses the
docker composeplugin, downloads its tools directly instead of using Phive and re-enablesfastcgi.loggingin the php-fpm images used for the tests.
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) : 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. -
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