Skip to content

Commit

Permalink
Fixed flow cli autoloading (#1243)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Oct 10, 2024
1 parent fcfe9f9 commit 4ec878a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cli/flow
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ use Symfony\Component\Console\Application;
if ('' !== Phar::running(false)) {
require 'phar://flow.phar/vendor/autoload.php';
} else {
require __DIR__ . '/../vendor/autoload.php';
if (\is_file(__DIR__ . '/vendor/autoload.php')) {
$autoloader = require __DIR__ . '/vendor/autoload.php';
} elseif (\is_file(__DIR__ . '/../vendor/autoload.php')) {
$autoloader = require __DIR__ . '/../vendor/autoload.php';
} elseif (\is_file(__DIR__ . '/../../../autoload.php')) {
$autoloader = require __DIR__ . '/../../../autoload.php';
} else {
echo 'Cannot find the vendor directory, have you executed composer install?' . PHP_EOL;
echo 'See https://getcomposer.org to get Composer.' . PHP_EOL;
exit(1);
}
}

if (false === \in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
Expand Down

0 comments on commit 4ec878a

Please sign in to comment.