From 3c466931c792d12b0bd870dc854ad765ea89de15 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 29 Mar 2018 13:39:23 +0200 Subject: [PATCH] Allow multiple paths for exists --- Autoloader.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Autoloader.php b/Autoloader.php index 996de4092..f4aba17ac 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -96,6 +96,12 @@ class Autoloader $class = ltrim($class, '\\'); $class = str_replace(['_', '\\'], '/', $class); - return file_exists(__DIR__ . '/../' . $class . '.php'); + foreach (self::$paths as $path) { + if (file_exists($file = $path . $class . '.php')) { + return true; + } + } + + return false; } }