symfony/symfony-standard — pull request #560 by lavoiesl (2013-06-13 23:40:50+00:00)
Title: Removed app/app_dev.php, now uses parameters from app/config/parameters.yml

Having to change the `.htaccess` and/or edit `web/app.php` and `web/app_dev.php` depending on the environment can tedious, cause discrepancies between branches in Git or force to use .gitignore files.

Since Symfony 2.3, `parameters.yml` is ignored and generated via `parameters.yml.dist`, so I had the idea to use this as base to generate an `app.php` based on the original `app.php` and `app_dev.php`.

Used parameters are:

* `environment`: (dev|test|prod)
* `http_cache`: (true|false) whether or not to use Symfony HTTP reverse proxy
* `localhost_only_dev`: (true|false) whether or not to limit request to localhost when in dev mode
* `apc_cache_id`: (false|string) if a valid string, use this as an APC id for the caches

If either of those variables are changed, you will have to remove app/cache/app.php

---

Parsing `parameters.yml` was taking roughly 2ms on my SSD so I thought it would be too much to have it parsed at each request. Generating a bootstrap file prevents this.

Doing a simple regex on the content of `parameters.yml` was fast enough, but ugly and a bit prone to parsing errors.

Of course, the concept is open for discussion; if someone can find a better way to do something similar, I would be glad to hear it.

_NB: app/console also reads the environment from parameters.yml, but parses at each use._