Created
February 27, 2014 08:23
-
-
Save Nemo64/9246368 to your computer and use it in GitHub Desktop.
A script that kills all caches in symfony
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
DEFAULT_ENVIREMENTS=( dev prod ) | |
FILE_USER=`whoami` | |
if [ $# -gt 0 ] | |
then ENVIREMENTS=$* | |
else ENVIREMENTS=$DEFAULT_ENVIREMENTS | |
fi | |
echo change ownership of app/cache app/logs and web/bundles to $FILE_USER | |
chown -RL $FILE_USER app/cache app/logs web/bundles | |
chmod +x app/console | |
#su $PHP_USER -c "chmod -R 755 app/cache app/logs" | |
for ENVIREMENT in ${ENVIREMENTS[@]} | |
do | |
echo start clearing $ENVIREMENT | |
app/console cache:clear --no-optional-warmers --env=$ENVIREMENT | |
echo clear doctrine metadata cache | |
app/console doctrine:cache:clear-metadata --env=$ENVIREMENT | |
echo update database | |
app/console doctrine:schema:update --force | |
echo installing assets | |
app/console assets:install --symlink --env=$ENVIREMENT | |
echo dumping assets | |
app/console assetic:dump --env=$ENVIREMENT | |
echo done! | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment