Last active
October 6, 2015 12:18
-
-
Save emarref/2992799 to your computer and use it in GitHub Desktop.
Symfony Bash Shortcut for 1.x and 2.x
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
#!/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 $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.