Skip to content

Commit

Permalink
Update autoload locating like in skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
fashxp authored Jun 10, 2020
1 parent bff32a9 commit dd88439
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@

ob_get_clean();

include __DIR__ . "/../vendor/autoload.php";
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
include $a;
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload.php')) {
include $a;
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
include $a;
} else {
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
exit(1);
}

\Pimcore\Bootstrap::setProjectRoot();

define('PIMCORE_CONSOLE', true);

/** @var \Pimcore\Kernel $kernel */
$kernel = \Pimcore\Bootstrap::startupCli();
$application = new \Pimcore\Console\Application($kernel);
$application->run();
$application->run();

0 comments on commit dd88439

Please sign in to comment.