diff --git a/bin/console b/bin/console index 118ccf52..854f3397 100755 --- a/bin/console +++ b/bin/console @@ -15,7 +15,17 @@ 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); @@ -23,4 +33,4 @@ define('PIMCORE_CONSOLE', true); /** @var \Pimcore\Kernel $kernel */ $kernel = \Pimcore\Bootstrap::startupCli(); $application = new \Pimcore\Console\Application($kernel); -$application->run(); \ No newline at end of file +$application->run();