diff --git a/Neos.Flow/Scripts/flow.php b/Neos.Flow/Scripts/flow.php index bba7a6b7d4..d7d3fd5d71 100644 --- a/Neos.Flow/Scripts/flow.php +++ b/Neos.Flow/Scripts/flow.php @@ -39,18 +39,6 @@ array_shift($argv); require(__DIR__ . '/migrate.php'); } else { - $autoloaderPath = dirname(__DIR__, 3) . '/Libraries/autoload.php'; - if (!file_exists($autoloaderPath)) { - echo 'Composers "autoload.php" file was not found. The file is expected to be located in the path:' . PHP_EOL . PHP_EOL; - echo $autoloaderPath . PHP_EOL . PHP_EOL; - echo 'This could be due to a missing "config" => "vendor-dir" section of your root "composer.json" file.' . PHP_EOL . PHP_EOL; - echo 'The section key and value should look like the following:' . PHP_EOL; - echo '"vendor-dir": "Packages/Libraries"' . PHP_EOL; - echo 'Update your "composer.json" file accordingly and run the "composer update" command.' . PHP_EOL; - exit(1); - } - $composerAutoloader = require($autoloaderPath); - if (DIRECTORY_SEPARATOR !== '/' && trim(getenv('FLOW_ROOTPATH'), '"\' ') === '') { $absoluteRootpath = dirname(realpath(__DIR__ . '/../../../')); if (realpath(getcwd()) === $absoluteRootpath) { @@ -65,6 +53,18 @@ $_SERVER['FLOW_ROOTPATH'] = trim(getenv('FLOW_ROOTPATH'), '"\' ') ?: dirname($_SERVER['PHP_SELF']); } + $autoloaderPath = $_SERVER['FLOW_ROOTPATH'] . '/Packages/Libraries/autoload.php'; + if (!file_exists($autoloaderPath)) { + echo 'Composers "autoload.php" file was not found. The file is expected to be located in the path:' . PHP_EOL . PHP_EOL; + echo $autoloaderPath . PHP_EOL . PHP_EOL; + echo 'This could be due to a missing "config" => "vendor-dir" section of your root "composer.json" file.' . PHP_EOL . PHP_EOL; + echo 'The section key and value should look like the following:' . PHP_EOL; + echo '"vendor-dir": "Packages/Libraries"' . PHP_EOL; + echo 'Update your "composer.json" file accordingly and run the "composer update" command.' . PHP_EOL; + exit(1); + } + $composerAutoloader = require($autoloaderPath); + $context = trim((string)\Neos\Flow\Core\Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT'), '"\' ') ?: 'Development'; $bootstrap = new \Neos\Flow\Core\Bootstrap($context, $composerAutoloader);