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

Description

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


$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

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

fixed with r19092

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.

fixed with r19235