Symfony2 CLI bash script

Since I have been trying out Symfony2 lately, I felt it was time to revise my old bash script for Symfony CLI and have it work with the new version of this lovely framework.

I have a working copy up and it turned out a little sexier than my previous script. This time around I am using glob expansion to look for Symfony’s files; symfony on Symfony 1.x and app/console on Symfony2. It taught me using the nullglob shell option to have bash keep looking for the other file variation.

If you are using Symfony, whatever version, and are occasionally running commands in your terminal, then I recommend you install and check it out! If you are running bash, installation is as simple as:

$ sudo wget -O /usr/local/bin/sf
$ sudo chmod +x /usr/local/bin/sf