Skip to content

Instantly share code, notes, and snippets.

@Nemo64
Created February 27, 2014 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nemo64/9246368 to your computer and use it in GitHub Desktop.
Save Nemo64/9246368 to your computer and use it in GitHub Desktop.
A script that kills all caches in symfony
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