Allow autoload to run on 5.6 still, add early exits when running composer or autoload.php with outdated PHP versions, fixes #10714, refs #10709
parent
2ef9e14c2f
commit
e0cce2bfb0
|
@ -5,6 +5,11 @@ if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
|
|||
echo 'Warning: Composer should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID < 70205) {
|
||||
echo 'Composer 2.3.0 dropped support for PHP <7.2.5 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
setlocale(LC_ALL, 'C');
|
||||
require __DIR__.'/../src/bootstrap.php';
|
||||
|
||||
|
|
|
@ -917,6 +917,11 @@ PLATFORM_CHECK;
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once $vendorPathToTargetDirCode;
|
||||
|
||||
return ComposerAutoloaderInit$suffix::getLoader();
|
||||
|
@ -993,9 +998,10 @@ CLASSLOADER_INIT;
|
|||
INCLUDE_PATH;
|
||||
}
|
||||
|
||||
// keeping PHP 5.6+ compatibility for the autoloader here by using call_user_func vs getInitializer()()
|
||||
$file .= <<<STATIC_INIT
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader));
|
||||
|
||||
|
||||
STATIC_INIT;
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitFilesAutoload::getLoader();
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitFilesAutoloadOrder::getLoader();
|
||||
|
|
|
@ -27,7 +27,7 @@ class ComposerAutoloaderInitFilesAutoloadOrder
|
|||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoloadOrder', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
set_include_path(implode(PATH_SEPARATOR, $includePaths));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class ComposerAutoloaderInitFilesAutoload
|
|||
spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoload', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitFilesAutoload::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class ComposerAutoloaderInitIncludePath
|
|||
spl_autoload_unregister(array('ComposerAutoloaderInitIncludePath', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitIncludePath::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitIncludePath::getInitializer($loader));
|
||||
|
||||
$loader->setUseIncludePath(true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitIncludePath', 'autoload'), true, true);
|
||||
|
|
|
@ -27,7 +27,7 @@ class ComposerAutoloaderInitTargetDir
|
|||
spl_autoload_unregister(array('ComposerAutoloaderInitTargetDir', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
\Composer\Autoload\ComposerStaticInitTargetDir::getInitializer($loader)();
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitTargetDir::getInitializer($loader));
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitTargetDir', 'autoload'), true, true);
|
||||
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitTargetDir::getLoader();
|
||||
|
|
Loading…
Reference in New Issue