Skip to content

Commit

Permalink
Merge pull request #11 from artemeon/fix-autoloading
Browse files Browse the repository at this point in the history
Fix autoload path
  • Loading branch information
marcreichel authored Feb 17, 2022
2 parents e061e67 + d3052f0 commit 013e3ee
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion mantis2github
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 013e3ee

Please sign in to comment.