Explicitly check if a file has already been required before requiring it
parent
943107cfe7
commit
61ed7a9547
|
@ -605,7 +605,14 @@ METHOD_FOOTER;
|
|||
|
||||
function composerRequire$suffix(\$file)
|
||||
{
|
||||
require \$file;
|
||||
static \$requiredFiles = array();
|
||||
\$fileSignature = md5_file(\$file);
|
||||
|
||||
if (empty(\$requiredFiles[\$fileSignature])) {
|
||||
require \$file;
|
||||
|
||||
\$requiredFiles[\$fileSignature] = true;
|
||||
}
|
||||
}
|
||||
|
||||
FOOTER;
|
||||
|
|
|
@ -51,5 +51,12 @@ class ComposerAutoloaderInitFilesAutoloadOrder
|
|||
|
||||
function composerRequireFilesAutoloadOrder($file)
|
||||
{
|
||||
require $file;
|
||||
static $requiredFiles = array();
|
||||
$fileSignature = md5_file($file);
|
||||
|
||||
if (empty($requiredFiles[$fileSignature])) {
|
||||
require $file;
|
||||
|
||||
$requiredFiles[$fileSignature] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,5 +67,12 @@ class ComposerAutoloaderInitIncludePath
|
|||
|
||||
function composerRequireIncludePath($file)
|
||||
{
|
||||
require $file;
|
||||
static $requiredFiles = array();
|
||||
$fileSignature = md5_file($file);
|
||||
|
||||
if (empty($requiredFiles[$fileSignature])) {
|
||||
require $file;
|
||||
|
||||
$requiredFiles[$fileSignature] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,5 +71,12 @@ class ComposerAutoloaderInitTargetDir
|
|||
|
||||
function composerRequireTargetDir($file)
|
||||
{
|
||||
require $file;
|
||||
static $requiredFiles = array();
|
||||
$fileSignature = md5_file($file);
|
||||
|
||||
if (empty($requiredFiles[$fileSignature])) {
|
||||
require $file;
|
||||
|
||||
$requiredFiles[$fileSignature] = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue