Skip to content

Instantly share code, notes, and snippets.

@emarref
Last active October 6, 2015 12:18
Show Gist options
  • Save emarref/2992799 to your computer and use it in GitHub Desktop.
Save emarref/2992799 to your computer and use it in GitHub Desktop.
Symfony Bash Shortcut for 1.x and 2.x
#!/usr/bin/env bash
# E.g. from your project directory, run
# sf cache:clear
# or
# sf cc to clear cache
# depending on whether or not you're in a 1.x or 2.x project
# or just
# sf
# to see all options
PHP_BIN=`which php`
PHP_OPTS='-d memory_limit=256M -d safe_mode=0'
if [ -f ./app/console ]; then
SYMFONY_SCRIPT='./app/console'
elif [ -f ./symfony ]; then
SYMFONY_SCRIPT='./symfony'
else
echo "Not a symfony project or could not find symfony script."
exit 1
fi
$PHP_BIN $PHP_OPTS $SYMFONY_SCRIPT $@
@emarref
Copy link
Author

emarref commented Jun 26, 2012

Add this script to your path somewhere. Just a convenience shortcut that's handy when you swap between 1.x and 2.x projects all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment