Issues

ZF-12356: Zend_Loader's loadFile() method always returns true.

Issue Type: Docs: Problem Created: 2012-08-02T00:40:55.000+0000 Last Updated: 2012-11-02T20:29:28.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Vestigal (vestigal) Assignee: Frank Brückner (frosch) Tags: - Zend_Loader

  • FixForZF1.12

Related issues: Attachments: - Zend_Loader.xml.patch

Description

On the page http://framework.zend.com/manual/en/…, it says that the loadFile() method "returns boolean FALSE on failure, for example if the specified file does not exist." This appears to not be the case. As far as I can tell, the loadFile() method always returns true.

Comments

Posted by Frank Brückner (frosch) on 2012-08-02T07:16:01.000+0000

Patch added.

Posted by Vestigal (vestigal) on 2012-08-02T16:35:17.000+0000

The above patch fixes the documentation, but, if possible, I think it would be better to have the loadFile() method return TRUE or FALSE, as the original documentation says.

Warnings could be suppressed by using @include and @include_once, but I'm not sure how we would check to see if the file had been successfully loaded. We could do something like this:

<pre class="literal">if((@include $file_name) === false) {
   return false;
}

return true;

But if the included file has code in it to return false, then this will fail. I'm not sure if there's a proper way to check for failure to include files, though, as I don't think surrounding it in a try/catch block would work, either.

Also, how do I attack a patch? I don't see anywhere to do that :\

Posted by Rob Allen (rob) on 2012-11-02T20:29:28.000+0000

Updated documentation to match reality as we won't be slowing down loadFile().

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts