detect environment system changed

Inspired by
http://stevegrunwell.com/blog/laravel-application-environment/