php-fig/fig-standards — pull request #28 by andrerom (2012-04-16 17:32:28+00:00)
Title: Initial proposal for PSR-2, clarification attempt for PSR-0

This is a try at clearing some of the issues that came up during discussions in php-internals on splClassLoader rfc.

The issues that seems to come up where:
* case sensitivity
* handling of missing files
* include path handling
* questions on why pear compatibility was kept

This commit is by no means a perfect response to these, it's an attempt to start the discussion on fixing them so we can potentially move on with spl[Class]Loader.
Given the original PSR and the example in it, I have assumes it intended to be strict on purpose as it makes it easy to implement, understand, debug as well as being fast.
Hence why this proposal moves further in that direction but keeps support for some stuff currently in use with options.

Some options I have chosen not to include yet as I don't fully know if there are any value in them, and how they should be specified.

These are:

* PSR_2_EXCEPTION: Adds checks to see if file exists, if not throws
exception. Still throws exception when combined with PSR_2_SILENT.

Given that autoload functionality in php does no currently support exceptions, I don't see any benefit atm.

* PSR_2_LOWERCASE: Changes namespace and class name to lowercase,
hence folder and file names must be in lowercase in this mode.

Might add value for those that want to avoid potential edge case issues when developing on mac and then moving the project to linux for instance.

* PSR_2_INCLUDEPATH: Look-up file using include path.

Symfony / Zend will have to contribute / agree on how such a option should work.