From 2fb4106dcc14163feebf0829ca2d8021c346db32 Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Mon, 14 Aug 2023 13:27:52 +0200 Subject: [PATCH] [BUGFIX] Use correct autoload path, in case this package is linked In current Composer versions, the binaries are not links any more but files to allow the packages to be linked (e.g. from path repository). For that Composer populates $GLOBALS['_composer_autoload_path'] in the created binary file to expose the correct path to the autoload file for this installation. So we should use this path if a current Composer version is used and can gracefully fall back to directory traversal for older versions. --- typo3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typo3 b/typo3 index 5314467..5163344 100755 --- a/typo3 +++ b/typo3 @@ -18,7 +18,7 @@ * that executes commands */ call_user_func(function() { - $classLoader = require __DIR__ . '/../../autoload.php'; + $classLoader = require ($GLOBALS['_composer_autoload_path'] ?? __DIR__ . '/../../autoload.php'); \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true)->get(\TYPO3\CMS\Core\Console\CommandApplication::class)->run(); });