Drop PHP <7.2 and HHVM support from autoload_real, individual autoload files are kept as is for BC
parent
4fdc8b8ee1
commit
06e445ce02
|
@ -400,7 +400,7 @@ EOF;
|
|||
} elseif (file_exists($includeFilesFilePath)) {
|
||||
unlink($includeFilesFilePath);
|
||||
}
|
||||
$filesystem->filePutContentsIfModified($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath, $staticPhpVersion));
|
||||
$filesystem->filePutContentsIfModified($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath));
|
||||
$checkPlatform = $config->get('platform-check') && !($this->platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter);
|
||||
$platformCheckContent = null;
|
||||
if ($checkPlatform) {
|
||||
|
@ -415,7 +415,7 @@ EOF;
|
|||
unlink($targetDir.'/platform_check.php');
|
||||
}
|
||||
$filesystem->filePutContentsIfModified($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
|
||||
$filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform));
|
||||
$filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $checkPlatform));
|
||||
|
||||
$filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
||||
$filesystem->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
|
||||
|
@ -937,11 +937,10 @@ AUTOLOAD;
|
|||
* @param string $suffix
|
||||
* @param bool $useGlobalIncludePath
|
||||
* @param string $prependAutoloader 'true'|'false'
|
||||
* @param string $staticPhpVersion
|
||||
* @param bool $checkPlatform
|
||||
* @return string
|
||||
*/
|
||||
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform)
|
||||
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $checkPlatform)
|
||||
{
|
||||
$file = <<<HEADER
|
||||
<?php
|
||||
|
@ -981,7 +980,7 @@ PLATFORM_CHECK;
|
|||
|
||||
$file .= <<<CLASSLOADER_INIT
|
||||
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true, $prependAutoloader);
|
||||
self::\$loader = \$loader = new \\Composer\\Autoload\\ClassLoader(\\dirname(\\dirname(__FILE__)));
|
||||
self::\$loader = \$loader = new \\Composer\\Autoload\\ClassLoader(\\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
|
||||
|
||||
|
||||
|
@ -998,43 +997,12 @@ INCLUDE_PATH;
|
|||
}
|
||||
|
||||
$file .= <<<STATIC_INIT
|
||||
\$useStaticLoader = PHP_VERSION_ID >= $staticPhpVersion && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if (\$useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader)();
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader));
|
||||
} else {
|
||||
|
||||
STATIC_INIT;
|
||||
|
||||
if (!$this->classMapAuthoritative) {
|
||||
$file .= <<<'PSR04'
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
|
||||
PSR04;
|
||||
}
|
||||
|
||||
if ($useClassMap) {
|
||||
$file .= <<<'CLASSMAP'
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
|
||||
CLASSMAP;
|
||||
}
|
||||
|
||||
$file .= " }\n\n";
|
||||
|
||||
if ($this->classMapAuthoritative) {
|
||||
$file .= <<<'CLASSMAPAUTHORITATIVE'
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
|
@ -1073,11 +1041,7 @@ REGISTER_LOADER;
|
|||
|
||||
if ($useIncludeFiles) {
|
||||
$file .= <<<INCLUDE_FILES
|
||||
if (\$useStaticLoader) {
|
||||
\$includeFiles = Composer\Autoload\ComposerStaticInit$suffix::\$files;
|
||||
} else {
|
||||
\$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
\$includeFiles = \Composer\Autoload\ComposerStaticInit$suffix::\$files;
|
||||
foreach (\$includeFiles as \$fileIdentifier => \$file) {
|
||||
composerRequire$suffix(\$fileIdentifier, \$file);
|
||||
}
|
||||
|
@ -1126,13 +1090,10 @@ FOOTER;
|
|||
* @param string $targetDir
|
||||
* @param string $vendorPath input for findShortestPathCode
|
||||
* @param string $basePath input for findShortestPathCode
|
||||
* @param string $staticPhpVersion
|
||||
* @return string
|
||||
*/
|
||||
protected function getStaticFile($suffix, $targetDir, $vendorPath, $basePath, &$staticPhpVersion)
|
||||
protected function getStaticFile($suffix, $targetDir, $vendorPath, $basePath)
|
||||
{
|
||||
$staticPhpVersion = 50600;
|
||||
|
||||
$file = <<<HEADER
|
||||
<?php
|
||||
|
||||
|
@ -1190,11 +1151,6 @@ HEADER;
|
|||
}
|
||||
|
||||
foreach ($maps as $prop => $value) {
|
||||
if (count($value) > 32767) {
|
||||
// Static arrays are limited to 32767 values on PHP 5.6
|
||||
// See https://bugs.php.net/68057
|
||||
$staticPhpVersion = 70000;
|
||||
}
|
||||
$value = strtr(
|
||||
var_export($value, true),
|
||||
array(
|
||||
|
|
|
@ -23,38 +23,15 @@ class ComposerAutoloaderInitFilesAutoloadOrder
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitFilesAutoloadOrder', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoloadOrder', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::getInitializer($loader)();
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireFilesAutoloadOrder($fileIdentifier, $file);
|
||||
}
|
||||
|
|
|
@ -23,38 +23,15 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireFilesAutoload($fileIdentifier, $file);
|
||||
}
|
||||
|
|
|
@ -23,42 +23,19 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
|
||||
|
||||
$includePaths = require __DIR__ . '/include_paths.php';
|
||||
$includePaths[] = get_include_path();
|
||||
set_include_path(implode(PATH_SEPARATOR, $includePaths));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireFilesAutoload($fileIdentifier, $file);
|
||||
}
|
||||
|
|
|
@ -23,30 +23,11 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
|
|
@ -23,30 +23,11 @@ class ComposerAutoloaderInitIncludePath
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitIncludePath', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitIncludePath', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitIncludePath::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitIncludePath::getInitializer($loader)();
|
||||
|
||||
$loader->setUseIncludePath(true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitIncludePath', 'autoload'), true, true);
|
||||
|
|
|
@ -23,40 +23,17 @@ class ComposerAutoloaderInitTargetDir
|
|||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitTargetDir', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitTargetDir', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitTargetDir::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
\Composer\Autoload\ComposerStaticInitTargetDir::getInitializer($loader)();
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitTargetDir', 'autoload'), true, true);
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitTargetDir::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitTargetDir::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireTargetDir($fileIdentifier, $file);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue