From: Alexander Ebert Date: Wed, 13 Mar 2019 12:14:37 +0000 (+0100) Subject: Autoloader should not check for file existence X-Git-Tag: 5.2.0_Alpha_1~184^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6f609fecc3864d2aa06dcb66d92902f53c95adb7;p=GitHub%2FWoltLab%2FWCF.git Autoloader should not check for file existence --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index c8d57dd717..ae23708434 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -789,9 +789,10 @@ class WCF { } if (isset(self::$autoloadDirectories[$applicationPrefix])) { $classPath = self::$autoloadDirectories[$applicationPrefix] . implode('/', $namespaces) . '.class.php'; - if (file_exists($classPath)) { - require_once($classPath); - } + + // PHP will implicitly check if the file exists when including it, which means that we can save a + // redundant syscall/fs access by not checking for existence ourselves. Do not use require_once()! + @include_once($classPath); } } }