RSS

Cleanup your Symfony

I recently switched to Symfony (which is great BTW).
Anyway, I found annoying that as a regular user I can’t delete the generated files with apache permissions, so I created a shell script which does exactly that.
Here it comes:

#!/usr/bin/env bash

DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."

ok() {
printf "\033[32m"
printf "[OK]"
printf "\033[0m"
printf "\n"
}

msg() {
printf "\e[1;34m$1\t"
}

msg "Cleaning cache" && sudo rm -r $DIR/app/cache/* && ok
msg "Cleaning logs" && sudo rm -r $DIR/app/logs/* && ok
printf "\033[0m"

Place it in your project’s bin folder and you’re good to go :-bd

Tags:

Friday, January 20th, 2012 at 5:44 am • PHP, Programming, Web DevelopmentRSS 2.0 feed • leave a response or trackback

Leave a Reply