Change environment detection
Merge branch 'test-environment' into laravel-4.2