-- Jack Sleight <[EMAIL PROTECTED]> wrote (on Wednesday, 19 March 2008, 10:44 AM +0000): > Anyone? > Does this deserve reopening the issue and marking it as unresolved?
Well, Zend_Loader::autoload() (which is the callback registered by Zend_Loader::registerAutoload()) actually wraps Zend_Loader::loadClass() in a try/catch block, and returns a boolean false if the class was not found. PHP Warnings simply indicate that the file was not loaded; they are not a fatal issue, but simply an indicator that something is potentially wrong. In your production environments, I would expect you would have display_errors off as it is, and these would never be seen. In your development environment, having these show is probably a good thing, as it shows potential breakage in your code. I wouldn't re-open the issue, but if you feel strongly about it, I'd recommend opening a separate issue asking for the following: that Zend_Loader::registerAutoload() register an error handler that catches only the warnings generated by include_once and suppresses them. And then we can restart the discussion. > Jack Sleight wrote: >> Hi, >> This issue was resolved in 1.5.0: >> http://framework.zend.com/issues/browse/ZF-2463, which resulted in the >> error suppression on the include_once on line 83 being removed. However, >> this causes PHP warnings when a file doesn't exist. This is a problem when >> using autoload, because autoload functions are not required to >> successfully include the file, they should simply attempt to include it if >> they can. No errors should occur if the file cannot be found. >> >> Line 83 should really be changed to: >> >> if (self::isReadable($file)) { >> include_once $file; >> } >> >> The current method effectively makes it impossible to simply check if a >> class exists, using autoload where required. > > -- > Jack > -- Matthew Weier O'Phinney PHP Developer | [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
