From d3052f01b9d4dcfc4289bc89e21886e83a2428d5 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Thu, 17 Feb 2022 17:33:08 +0100 Subject: [PATCH] Fix autoload path --- mantis2github | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mantis2github b/mantis2github index 730aa44..9f0d3fd 100644 --- a/mantis2github +++ b/mantis2github @@ -12,7 +12,23 @@ (new class() { public function main() { - require_once $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php'; + if (isset($GLOBALS['_composer_autoload_path'])) { + define('COMPOSER_INSTALL_PATH', $GLOBALS['_composer_autoload_path']); + + unset($GLOBALS['_composer_autoload_path']); + } else { + foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) { + if (file_exists($file)) { + define('COMPOSER_INSTALL_PATH', $file); + + break; + } + } + + unset($file); + } + + require COMPOSER_INSTALL_PATH; $configValues = (new \Artemeon\M2G\Config\ConfigReader())->read(); $githubConnector = new \Artemeon\M2G\Service\GithubConnector($configValues);