middlewares/utils
Common utils for PSR-15 middleware packages
v4.0.2
4.0M downloads/mo
#2293 most downloaded on Packagist
middlewares/utils
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 9 days to 2.5 years
Nearly every release is documented
notes for 33 of 33 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
33 releases · first in 2016
0 releases in the last 12 months
see the full history below
Release timeline
33 releases · Sep 2016 to Jan 2025
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
Releases
latest 33-
v4.0.223 Jan 2025 -
v4.0.121 Nov 2024 -
v4.0.017 Dec 2023Release notes
Open source →Added
- Support for psr/http-message 2.x (if you don't use slim/psr7 or sunrise/http-message as factory)
Changed
- Updated dependencies and tests
Removed
- Support for PHP prior to 8.1.
-
v3.3.004 Jul 2021 -
v3.2.030 Nov 2020 -
v3.1.019 Jan 2020Release notes
Open source →Changed
- Zend Diactoros is deprecated, switched to Laminas Diactoros [#20], [#21].
THIS IS A BREAKING CHANGE, so, if you want to keep using Zend Diactoros, you should configure the
Factoryas follows:Factory::setFactory( new FactoryDiscovery([ 'request' => 'Zend\Diactoros\RequestFactory', 'response' => 'Zend\Diactoros\ResponseFactory', 'serverRequest' => 'Zend\Diactoros\ServerRequestFactory', 'stream' => 'Zend\Diactoros\StreamFactory', 'uploadedFile' => 'Zend\Diactoros\UploadedFileFactory', 'uri' => 'Zend\Diactoros\UriFactory', ]) );
- Zend Diactoros is deprecated, switched to Laminas Diactoros [#20], [#21].
THIS IS A BREAKING CHANGE, so, if you want to keep using Zend Diactoros, you should configure the
-
v3.0.129 Nov 2019 -
v3.0.029 Nov 2019Release notes
Open source →Added
- Added
FactoryInterfacethat returns all PSR-17 factories - Added
FactoryDiscoveryclass to discover automatically PSR-17 implementation libraries - Added
Factory::getFactory()andFactory::setFactory()to set manually PSR-17 factories - Added
Factory::getResponseFactory() - Added
Factory::getRequestFactory() - Added
Factory::getServerRequestFactory() - Added
Factory::getStreamFactory() - Added
Factory::getUriFactory() - Added
Factory::getUploadedFileFactory() - Added
Sunriseto the list of factories detected automatically
Removed
- Support for PHP 7.0 and 7.1
Factory::setStrategyHttpErrorException::setContextmethod, to make the exception class inmutable- Traits
HasResponseFactoryandHasStreamFactory
- Added
-
v2.2.005 Mar 2019Release notes
Open source →Added
Middlewares\Utils\DispatcherimplementsRequestHandlerInterface[#16], [#17]
-
v2.1.111 Aug 2018 -
v2.1.002 Aug 2018Release notes
Open source →Added
- New trait
HasResponseFactoryused by many middlewares that need to configure the PSR-17 response factory. - New trait
HasStreamFactoryused by many middlewares that need to configure the PSR-17 stream factory.
- New trait
-
v2.0.001 Aug 2018Release notes
Open source →Added
- New methods added to
Factoryto return PSR-17 factories:getResponseFactory,getServerRequestFactory,getStreamFactoryandgetUriFactory. - New method
Factory::setStrategies()to configure the priority order of the Diactoros, Guzzle and Slim factories or register new classes. - Added a second argument to
Callablehandlerconstructor to pass a response factory
Changed
- Exchanged abandoned
http-interop/http-factorywithpsr/http-factory - Changed the signature of
Factory::createServerRequest()to be aligned with PSR-17 - Changed the signature of
Factory::createStream()to be aligned with PSR-17 - Changed the signature of
Factory::createResponse()to be aligned with PSR-17
- New methods added to
-
v1.2.017 Jul 2018 -
v1.1.025 Jun 2018 -
v1.0.024 Jan 2018Release notes
Open source →Changed
- Replaced
http-interop/http-server-middlewarewithpsr/http-server-middleware.
Removed
- Removed
Middlewares\Utils\Helpersbecause contains just one helper and it's no longer needed.
- Replaced
-
v0.14.016 Dec 2017Release notes
Open source →Added
- New class
RequestHandlerContainerimplementing PSR-11 to resolve handlers in any format (classes, callables) and return PSR-15RequestHandlerInterfaceinstances. This can be used to resolve router handlers, for example.
Changed
- The signature of
CallableHandlerwas simplified. Removed$resolverand$argumentsin the constructor.
Removed
- Deleted all callable resolvers classes. Use the
RequestHandlerContainer, or any other PSR-11 implementation.
- New class
-
v0.13.016 Nov 2017Release notes
Open source →Changed
- The minimum PHP version supported is 7.0
- Replaced
http-interop/http-middlewarewithhttp-interop/http-server-middleware. - Changed
Middlewares\Utils\CallableHandlersignature. Now it is instantiable and can be used as middleware and server request handler.
Removed
Middlewares\Utils\CallableMiddleware. UseMiddlewares\Utils\CallableHandlerinstead.
-
v0.12.018 Sep 2017Release notes
Open source →Changed
- Append
.distsuffix to phpcs.xml and phpunit.xml files - Changed the configuration of phpcs and php_cs
- Upgraded phpunit to the latest version and improved its config file
- Updated
http-interop/http-middlewareto0.5
- Append
-
v0.11.106 May 2017Release notes
Open source →Changed
Middlewares\Utils\CallableHandlerexpects one of the following values returned by the callable:- A
Psr\Http\Message\ResponseInterface nullor scalar- an object with
__toStringmethod implemented Otherwise, throws anUnexpectedValueException
- A
Middlewares\Helpers::fixContentLengthonly modifies or removes theContent-Lengthheader, but does not add it if didn't exist previously.
-
v0.11.025 Mar 2017Release notes
Open source →Added
- New class
Middlewares\Utils\Helperswith common helpers to manipulate PSR-7 messages - New helper
Middlewares\Utils\Helpers::fixContentLengthused to add/modify/remove theContent-Lengthheader of a http message.
Changed
- Updated
http-interop/http-factoryto0.3
- New class
-
v0.10.127 Feb 2017 -
v0.10.027 Feb 2017Release notes
Open source →Changed
- Replaced deprecated
container-interopbypsr/contaienr(PSR-11). Middlewares\Utils\Dispatcherthrows exceptions if the middlewares does not implementInterop\Http\ServerMiddleware\MiddlewareInterfaceor does not return an instance ofPsr\Http\Message\ResponseInterface.- Moved the default factories to
Middlewares\Utils\Factorynamespace. - Minor code improvements.
- Replaced deprecated
-
v0.9.005 Feb 2017Release notes
Open source →Added
- Callable resolves to create callables from various representations
Removed
Middlewares\Utils\CallableHandler::resolve
-
v0.8.022 Dec 2016Release notes
Open source →Changed
- Updated
http-interop/http-middlewareto0.4 - Updated
friendsofphp/php-cs-fixerto2.0
- Updated
-
v0.7.006 Dec 2016Release notes
Open source →Added
- New static helper
Middlewares\Utils\Dispatcher::runto create and dispatch a request easily
- New static helper
-
v0.6.106 Dec 2016Release notes
Open source →Fixed
- Ensure that the body of the serverRequest is writable and seekable.
-
v0.6.006 Dec 2016Release notes
Open source →Added
- ServerRequest factory
Middlewares\Utils\DispatcheracceptsClosureas middleware components
Changed
Middlewares\Utils\Dispatchercreates automatically a response if the stack is exhausted
-
v0.5.022 Nov 2016Release notes
Open source →Added
Middlewares\Utils\CallableMiddlewareclass, to create middlewares from callablesMiddlewares\Utils\Dispatcherclass, to execute the middleware stack and return a response.
-
v0.4.013 Nov 2016 -
v0.3.103 Oct 2016Release notes
Open source →Fixed
- Bug in CallableHandler that resolve to the declaring class of a method instead the final class.
-
v0.3.003 Oct 2016Release notes
Open source →Added
Middlewares\Utils\CallableHandlerclass, allowing to resolve and execute callables safely.
-
v0.2.001 Oct 2016 -
v0.1.030 Sep 2016