Преглед на файлове

ZF-8354: added check if file exists

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19092 44c647ce-9c0f-0410-b52a-842ac1e357ba
bate преди 16 години
родител
ревизия
a2f38561e6
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      library/Zend/Controller/Dispatcher/Standard.php

+ 3 - 1
library/Zend/Controller/Dispatcher/Standard.php

@@ -335,7 +335,9 @@ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abs
         $dispatchDir = $this->getDispatchDirectory();
         $dispatchDir = $this->getDispatchDirectory();
         $loadFile    = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className);
         $loadFile    = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className);
 
 
-        if (!include_once $loadFile) {
+        if (file_exists($loadFile)) {
+            include_once $loadFile;
+        } else {
             require_once 'Zend/Controller/Dispatcher/Exception.php';
             require_once 'Zend/Controller/Dispatcher/Exception.php';
             throw new Zend_Controller_Dispatcher_Exception('Cannot load controller class "' . $className . '" from file "' . $loadFile . "'");
             throw new Zend_Controller_Dispatcher_Exception('Cannot load controller class "' . $className . '" from file "' . $loadFile . "'");
         }
         }