ソースを参照

Making autoloader act nicer to autoloaders that may be running in parallel

Irakli Nadareishvili 12 年 前
コミット
703c3ceb90
1 ファイル変更4 行追加1 行削除
  1. 4 1
      lib/Predis/Autoloader.php

+ 4 - 1
lib/Predis/Autoloader.php

@@ -52,7 +52,10 @@ class Autoloader
     {
         if (0 === strpos($className, $this->prefix)) {
             $parts = explode('\\', substr($className, $this->prefixLength));
-            require($this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php');
+            $filepath = $this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php';
+            if (file_exists($filepath)) {
+                require_once($filepath);
+            }
         }
     }
 }