1
0
Fork 0

dedicated scope isolation function for autoload_real

pull/2673/head
Nicolas Grekas 2014-02-06 11:53:42 +01:00
parent ed02997a7b
commit 00a6f8e38d
6 changed files with 34 additions and 9 deletions

View File

@ -530,10 +530,10 @@ REGISTER_AUTOLOAD;
REGISTER_LOADER;
if ($useIncludeFiles) {
$file .= <<<'INCLUDE_FILES'
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
\Composer\Autoload\includeFile($file);
$file .= <<<INCLUDE_FILES
\$includeFiles = require __DIR__ . '/autoload_files.php';
foreach (\$includeFiles as \$file) {
composerRequire$suffix(\$file);
}
@ -552,6 +552,11 @@ METHOD_FOOTER;
return $file . <<<FOOTER
}
function composerRequire$suffix(\$file)
{
require \$file;
}
FOOTER;
}

View File

@ -358,7 +358,7 @@ class ClassLoader
*
* Prevents access to $this/self from included files.
*/
function includeFile()
function includeFile($file)
{
include func_get_arg(0);
include $file;
}

View File

@ -45,9 +45,14 @@ class ComposerAutoloaderInitFilesAutoloadOrder
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
\Composer\Autoload\includeFile($file);
composerRequireFilesAutoloadOrder($file);
}
return $loader;
}
}
function composerRequireFilesAutoloadOrder($file)
{
require $file;
}

View File

@ -45,9 +45,14 @@ class ComposerAutoloaderInitFilesAutoload
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
\Composer\Autoload\includeFile($file);
composerRequireFilesAutoload($file);
}
return $loader;
}
}
function composerRequireFilesAutoload($file)
{
require $file;
}

View File

@ -67,3 +67,8 @@ class ComposerAutoloaderInitIncludePath
}
}
}
function composerRequireIncludePath($file)
{
require $file;
}

View File

@ -47,7 +47,7 @@ class ComposerAutoloaderInitTargetDir
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
\Composer\Autoload\includeFile($file);
composerRequireTargetDir($file);
}
return $loader;
@ -71,3 +71,8 @@ class ComposerAutoloaderInitTargetDir
}
}
}
function composerRequireTargetDir($file)
{
require $file;
}