vlucas/phpdotenv — pull request #44 by kelvinj (2014-10-29 12:13:41+00:00)
Title: dotenv v2

As mentioned in #43 I've tried a few different things:

1. PSR-4 and PSR-2
2. namespaced to `Dotenv` with main public API in `Dotenv\Dotenv`
3. Broken functionality into smaller distinct classes with single responsibility
4. Changed immutability, making it a little less clunky, so now we have `load` = immutable and `overload` = mutable. I know you didn't want to copy the ruby dotenv @vlucas but I felt this was pretty elegant.
5. Parsing of variables now done with a series of filters. To extend parsing as in #40 the `Dotenv\Dotenv` class can be extended and a new filter added to the parser. Or indeed a different parser.
6. I also added a help `dotenv()` function in order to simplify instantiation, e.g. `dotenv()->load(…)` as an experiement.
7. haven't yet implemented a static factory as requested by @bcremer in #43

Comments please.