50bhan / symfony-route-usage
Detect used and unused Symfony routes
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.3
- knplabs/doctrine-behaviors: ^2.0.7
- symplify/package-builder: ^9.1.9
- symplify/smart-file-system: ^9.1.9
- symplify/symplify-kernel: ^9.1.9
Requires (Dev)
- dama/doctrine-test-bundle: ^6.3
- doctrine/annotations: ^1.10
- doctrine/cache: ^1.10
- doctrine/dbal: ^2.10
- doctrine/doctrine-bundle: ^2.2
- doctrine/orm: ^2.7
- phpunit/phpunit: ^9.5
- symfony/framework-bundle: ^4.4|^5.2
- symfony/http-kernel: ^4.4|^5.2
- symfony/routing: ^4.4|^5.2
- symfony/security-bundle: ^4.4|^5.2
- symfony/security-core: ^4.4|^5.2
- dev-master / 9.2.x-dev
- 9.1.9
- 9.1.8
- 9.1.7
- 9.1.6
- 9.1.5
- 9.1.4
- 9.1.3
- 9.1.1
- 9.1.0
- 9.0.50
- 9.0.49
- 9.0.48
- 9.0.47
- 9.0.46
- 9.0.45
- 9.0.44
- 9.0.43
- 9.0.42
- 9.0.41
- 9.0.40
- 9.0.39
- 9.0.38
- 9.0.37
- 9.0.36
- 9.0.35
- 9.0.34
- 9.0.33
- 9.0.32
- 9.0.31
- 9.0.30
- 9.0.29
- 9.0.28
- 9.0.27
- 9.0.26
- 9.0.25
- 9.0.24
- 9.0.23
- 9.0.22
- 9.0.21
- 9.0.20
- 9.0.19
- 9.0.18
- 9.0.16
- 9.0.15
- 9.0.14
- 9.0.13
- 9.0.12
- 9.0.11
- 9.0.10
- 9.0.9
- 9.0.8
- 9.0.7
- 9.0.6
- 9.0.5
- 9.0.4
- 9.0.3
- 9.0.2
- 9.0.1
- 9.0.0
- 9.0.0-rc1
- 9.0.0-BETA9
- 9.0.0-BETA8
- 9.0.0-BETA7
- 9.0.0-BETA6
- 9.0.0-BETA5
- 9.0.0-BETA4
- 9.0.0-BETA3
- 9.0.0-BETA2
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.59
- 0.3.52
- 0.3.51
- 0.3.50
- 0.3.49
- 0.3.48
- 0.3.47
- 0.3.46
- 0.3.45
- 0.3.44
- 0.3.43
- 0.3.42
- 0.3.41
- 0.3.40
- 0.3.39
- 0.3.38
- 0.3.37
- 0.3.36
- 0.3.35
- 0.3.34
- 0.3.33
- v0.3.32
- v0.3.31
- v0.3.30
- v0.3.29
- v0.3.28
- v0.3.27
- v0.3.26
- v0.3.25
- v0.3.24
- v0.3.22
- v0.3.21
- v0.3.20
- v0.3.19
- v0.3.18
- v0.3.17
- v0.3.16
- v0.3.15
- v0.3.14
- v0.3.13
- v0.3.12
- v0.3.11
- v0.3.10
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
This package is auto-updated.
Last update: 2024-11-21 04:15:38 UTC
README
Read about this package: How to Find Dead Symfony Routes
Inspired by Route Usage for Laravel:
"This package keeps track of all requests to know what controller method, and when it was called. The goal is not to build some sort of analytics but to find out if there are unused endpoints or controller method.
After a few years, any projects have dead code and unused endpoint. Typically, you removed a link on your frontend, nothing ever links to that old /special-page. You want to remove it, but you're not sure. Have look at the route_usage table and figure out when this page was accessed for the last time. Last week? Better keep it for now. 3 years ago? REMOVE THE CODE!"
Install
composer require symplify/symfony-route-usage
Register bundle to your config/bundles.php
(in case Flex misses it):
return [ Symplify\SymfonyRouteUsage\SymfonyRouteUsageBundle::class => [ 'all' => true, ], ];
Usage
Show used routes:
bin/console show-route-usage
Show dead routes:
bin/console show-dead-routes
Configuration
By default, _*
and error_controller
is excluded. If you want to exclude more routes, use regex parameter:
# config/services.yaml parameters: route_usage_exclude_route_regex: '#legacy#'
Report Issues
In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker
Contribute
The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.