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:
parent
943107cfe7
commit
61ed7a9547
5 changed files with 40 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue