Skip to content

Commit

Permalink
[BUGFIX] Correctly identify the composer autoload path in blueconsole
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexvaar committed Feb 12, 2024
1 parent 6552d79 commit 46d073d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/blueconsole/bin/blueconsole
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ if (empty(ini_get('date.timezone'))) {
date_default_timezone_set('UTC');
}

require_once(__DIR__ . '/../../../vendor/autoload.php');
if (isset($GLOBALS['_composer_autoload_path']) && file_exists($GLOBALS['_composer_autoload_path'])) {
require $GLOBALS['_composer_autoload_path'];
} elseif (file_exists(__DIR__ . '/../../../autoload.php')) {
require_once(__DIR__ . '/../../../autoload.php');
} elseif(file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
require_once(__DIR__ . '/../../../vendor/autoload.php');
} else {
throw new Exception('Could not identifie composer autoload. Have you installed this package with composer?');
}

if (file_exists($root . '/.env')) {
$dotenv = new Dotenv();
Expand Down

0 comments on commit 46d073d

Please sign in to comment.