1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Explicitly check if a file has already been required before requiring it

This commit is contained in:
Jonathan Eskew 2015-06-27 13:54:53 -07:00
parent 943107cfe7
commit 61ed7a9547
5 changed files with 40 additions and 5 deletions

View file

@ -51,5 +51,12 @@ class ComposerAutoloaderInitFilesAutoload
function composerRequireFilesAutoload($file)
{
require $file;
static $requiredFiles = array();
$fileSignature = md5_file($file);
if (empty($requiredFiles[$fileSignature])) {
require $file;
$requiredFiles[$fileSignature] = true;
}
}