noodlehaus/dispatch — pull request #43 by nmcgann (2014-02-27 08:06:42+00:00)
Title: Improved default base dir detection. Refactor error() for single exit

Two simple changes.

Refactored `error()` to have a single exit point. (I stopped short of adding an optional `$no_exit` parameter, that was just one possible idea about testability)

Improved the default base directory detection in `dispatch()`. This trick is seen in lots of frameworks and works well. It can still be explicitly overridden by the `config()`.