ostrolucky / traceroute
Detect unused routes
Installs: 2 164
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
Requires (Dev)
- doctrine/annotations: ^1
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.7
- phpunit/phpunit: ^9.3
- symfony/browser-kit: ^4.4|^5.0
- symfony/dependency-injection: ^4.4.3|^5.0.3
- symfony/framework-bundle: ^4.4.2|^5.0.2
This package is auto-updated.
Last update: 2024-11-12 23:40:37 UTC
README
traceroute
monitors usage of your application's routes, then shows you unused routes. You might want to do this in order to be able to get rid of unused controllers.
It's inspired by projects such as Symfony's symfony-route-usage, Laravel's route-usage and Rails's traceroute.
It differs from them by being less opinionated and having no dependencies, thanks to SOLID and decoupled design. Framework integrations come as optional bridges, currently shipping with bridge compatible with Symfony 3/4/5.
Install
composer require ostrolucky/traceroute
Symfony framework installation
Register bridge/bundle in your config/bundles.php
:
return [ Ostrolucky\Traceroute\Bridge\Symfony\TraceRouteBundle::class => ['prod' => true], ];
Usage
Most of the time library happily monitors route usage in background automatically, recording this information in database table.
You are free to query this table yourself, however what you cannot do is cross-check this table which contains used routes with all routes defined in your application. That's what following command is for:
bin/console ostrolucky:unused-routes
It will simply output unused route names, meaning routes that are defined in your application, but were never accessed.
Licensing
GPLv3 license. Please see License File for more information.