Skip to content

Commit d3052f0

Browse files
committed
Fix autoload path
1 parent e061e67 commit d3052f0

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

mantis2github

+17-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,23 @@
1212
(new class() {
1313
public function main()
1414
{
15-
require_once $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
15+
if (isset($GLOBALS['_composer_autoload_path'])) {
16+
define('COMPOSER_INSTALL_PATH', $GLOBALS['_composer_autoload_path']);
17+
18+
unset($GLOBALS['_composer_autoload_path']);
19+
} else {
20+
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
21+
if (file_exists($file)) {
22+
define('COMPOSER_INSTALL_PATH', $file);
23+
24+
break;
25+
}
26+
}
27+
28+
unset($file);
29+
}
30+
31+
require COMPOSER_INSTALL_PATH;
1632

1733
$configValues = (new \Artemeon\M2G\Config\ConfigReader())->read();
1834
$githubConnector = new \Artemeon\M2G\Service\GithubConnector($configValues);

0 commit comments

Comments
 (0)