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

Issue Type: New Feature Created: 2007-02-26T16:32:40.000+0000 Last Updated: 2007-07-05T14:43:52.000+0000 Status: Resolved Fix version(s): - 0.9.2 (06/Apr/07)

Reporter: Matthew Weier O'Phinney (matthew) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Loader

Related issues: Attachments:


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

<pre class="highlight">
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.


Posted by Bill Karwin (bkarwin) on 2007-03-01T16:16:25.000+0000

Assign to Matthew.

Posted by Matthew Ratzloff (mratzloff) on 2007-03-07T11:02:53.000+0000

See [[…]]

Nico's idea is:

<pre class="highlight">
require_once 'Zend/Loader.php';

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

Posted by Bill Karwin (bkarwin) on 2007-03-09T00:42:46.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2007-03-29T11:23:43.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.