ZF-981: Add autoload() method to Zend_Loader class


Add an spl_autoload()-compatible autoload() method to the Zend class to make a drop-in callback for autoloading possible. Usage should be:

spl_autoload_register(array('Zend', 'autoload'));

This can be accomplished by wrapping calls to Zend::loadClass() in a try/catch block, and returning false if an exception has bee caught.


Assign to Matthew.

See [[…]]

Nico's idea is:

require_once 'Zend/Loader.php';

I like this. Alternately, it could just be {{Zend_Loader::autoload()}}.

The Zend.php file is being deprecated and will be removed by ZF 1.0. So if we implement an autoload function, the natural place to put it would be in Zend/Loader.php.

Added Zend_Loader::autoload() prior to 0.9.1; added Zend_Loader::registerAutoload() in r4259.