#! /bin/bash
#
# This script will remove all cache-files.
#
# @version	1.1.2

SCRIPT_PATH="`dirname \"$0\"`"

rm -f `find ${SCRIPT_PATH}/../src/Frontend/Cache/Locale/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f `find ${SCRIPT_PATH}/../src/Frontend/Cache/MinifiedCss/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f `find ${SCRIPT_PATH}/../src/Frontend/Cache/MinifiedJs/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f `find ${SCRIPT_PATH}/../src/Frontend/Cache/Navigation/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f `find ${SCRIPT_PATH}/../src/Frontend/Cache/CompiledTemplates/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f ${SCRIPT_PATH}/../src/Frontend/Cache/*.cache

rm -f `find ${SCRIPT_PATH}/../src/Backend/Cache/Locale/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f `find ${SCRIPT_PATH}/../src/Backend/Cache/CompiledTemplates/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`
rm -f ${SCRIPT_PATH}/../src/Backend/Cache/*.cache

rm -f `find ${SCRIPT_PATH}/../app/cache/ ! -name ".gitignore" -type f ! -path *.svn/* -type f`

${SCRIPT_PATH}/../app/console cache:clear
${SCRIPT_PATH}/../app/console cache:clear --env=prod
${SCRIPT_PATH}/../app/console cache:clear --env=install

rm -rf {SCRIPT_PATH}/../app/cache/*

echo 'All done! Cache files removed.'
