dedicated scope isolation function for autoload_real

main
Nicolas Grekas 10 years ago
parent ed02997a7b
commit 00a6f8e38d

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

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

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

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

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

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

Loading…
Cancel
Save