Elgg/Elgg — pull request #465 by mrclay (2012-12-09 19:19:36+00:00)
Title: Fixes #4957: Adds DI container 

Posting this for review. Basically this creates a generic-use PHP5.2 DI container (inspired by Pimple and Symfony's DIC), and a service container based on it.

All reads are done via property access and all shared values are cached as properties so subsequent reads actually get the object itself rather than incurring the overhead of __get() calls. Also nearly all values can be resolved at read-time by referencing other values from the container. The container can contain factory objects that can construct objects with arguments and call setters if needed.

This also fixes the autoloader to autoload core classes with "_" in the name, which is fine for 1.8. The core classes dir also doesn't have to be scanned. This is completely forward compatible with the autoloading in 1.9.