Download the PHP package halloverden/symfony-route-deprecation-bundle without Composer
On this page you can find all versions of the php package halloverden/symfony-route-deprecation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download halloverden/symfony-route-deprecation-bundle
More information about halloverden/symfony-route-deprecation-bundle
Files in halloverden/symfony-route-deprecation-bundle
Package symfony-route-deprecation-bundle
Short Description The Route Deprecation Bundle provides tools to deprecate routes in your Symfony application. It implements the IETF draft of The Deprecation HTTP Header Field.
License MIT
Informations about the package symfony-route-deprecation-bundle
Route Deprecation Bundle
The Route Deprecation Bundle provides tools to deprecate routes in your Symfony application. It implements the IETF draft of The Deprecation HTTP Header Field.
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
Usage
You can deprecate any route with the DeprecatedRoute
annotation.
since
(required) - is astring ("yyyy-mm-dd")
that defines the moment in which a route becomes deprecated. The headerDeprecation
will be set on the response, like so:Deprecation: @1672531200
.sunset
(optional) - is astring ("yyyy-mm-dd")
that defines the moment in which a route becomes expired. The headerSunset
will be set on the response, like so:Sunset: Mon, 01 Jun 2020 00:00:00 GMT
enforce
(optional) - is aboolean
that makes the route inaccessible after thesunset
date (default isfalse
). If you try to access a route where this option is set totrue
and the current date is greater than thesunet
date, aGoneHttpException
is thrown.name
(optional) - The name of the route to deprecate. If not specified, all routes (on that controller) will be deprecated.deprecationDateTimeFormat
(optional) - The format of the date time used in the Deprecation header. default is@U
(as per the IETF draft).sunsetDateTimeFormat
(optional) - The format of the date time used in the Sunset header. default isD, d M Y H:i:s \G\M\T
(as per the Sunset RFC)deprecationLink
(optional) - The link used in theLink
header for deprecation.sunsetLink
- (optional) - The link used in theLink
header for sunset.
you can also deprecate any route with route parameters.
Example using the attribute:
Example using route parameters in routes.yaml (you can also use xml, php and the route annotation):
config options (optional):
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
All versions of symfony-route-deprecation-bundle with dependencies
symfony/clock Version ^6.4|^7.0
symfony/framework-bundle Version ^6.4|^7.0