Skip to content

Instantly share code, notes, and snippets.

@mgirouard
Last active December 25, 2015 18:09
Show Gist options
  • Save mgirouard/7018217 to your computer and use it in GitHub Desktop.
Save mgirouard/7018217 to your computer and use it in GitHub Desktop.
Symfony Helpers
#!/bin/bash
##
# Devify your Symfony install.
#
# Clears the cache, deploys symlinks of the public assets.
##
php app/console cache:clear &&\
php app/console assets:install --symlink
#!/bin/bash
##
# Prodify your Symfony install.
#
# Clears the cache, deploys hard copies of the public assets, and dumps
# assetic files to the web directory.
##
php app/console cache:clear --env=prod &&\
php app/console assets:install --env=prod &&\
php app/console assetic:dump --env=prod
#!/bin/bash
##
# Wipes and reloads all application data
##
php app/console doctrine:schema:drop --force &&\
php app/console doctrine:schema:create &&\
php app/console doctrine:fixtures:load
#!/bin/bash
##
# Fetches a parameter from a symfony configuration
# Useful when you need to automate things and hand off symfony configuration
##
[[ $1 && $2 ]] || {
echo "Usage: yml-param <term> <file>"
exit 1
}
grep $1 $2 | sed 's/^\s\+'$1':\s\+\?//' | head -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment