Created
March 22, 2017 17:35
-
-
Save webevt/b1f79d5c3b1a6f1a7d7fa34f2c960ecf to your computer and use it in GitHub Desktop.
Find non-existent services in Symfony app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/console debug:container | tail -n +8 | head -n-5 | grep -v "alias for" | while read -r LINE; do CLASS=$(echo $LINE | awk '{print $2}'); SERVICE=$(echo $LINE | awk '{print $1}'); if [ -z $CLASS ]; then continue; fi; php -r "require_once 'app/autoload.php'; class_exists('$CLASS') || interface_exists('$CLASS') ?: print('Service $SERVICE ($CLASS) does not exist'.PHP_EOL);"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment