Issues

ZF-8354: Dispatcher : include_once statement can generate a Warning if the file does not exists

Issue Type: Bug Created: 2009-11-20T06:09:17.000+0000 Last Updated: 2009-11-25T06:40:34.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Raphael Dehousse (thymus) Assignee: Marco Kaiser (bate) Tags: - Zend_Controller

Related issues: Attachments:

Description

The following (around line 337) from Zend_Controller_Dispatcher_Standard should be refactored:

<pre class="highlight">
$dispatchDir = $this->getDispatchDirectory();
        $loadFile    = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className);

        if (!include_once $loadFile) {
            require_once 'Zend/Controller/Dispatcher/Exception.php';
            throw new Zend_Controller_Dispatcher_Exception('Cannot load controller class "' . $className . '" from file "' . $loadFile . "'");
        }

include_once statement can generate a Warning if the file does not exists It should be @include_once or check with file_exists

Comments

Posted by Raphael Dehousse (thymus) on 2009-11-20T06:10:16.000+0000

I'm not able to reopen the issue ZF-4736

So, I clone it to say :

Hello,

This issue should be reopened because the include_once statement can generate a Warning if the file does not exists. It should be @include_once or check with file_exists

Thanks to fix this

Cheers,

Raphaƫl Dehousse

Posted by Marco Kaiser (bate) on 2009-11-20T06:59:27.000+0000

fixed with r19092

Posted by Matthew Weier O'Phinney (matthew) on 2009-11-25T06:34:16.000+0000

Marco -- please modify this to use Zend_Loader::isReadable() in place of file_exists. file_exists() does not take into account the include_path, and as such could generate a false negative.

Posted by Marco Kaiser (bate) on 2009-11-25T06:40:34.000+0000

fixed with r19235

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