4 * if we're running from phar load the phar autoload,
5 * else let the script 'robo' search for the autoloader.
6 * If we cannot find a vendor/autoload.php file, then
7 * we will go ahead and try the phar.
9 $autoloaderPath = 'phar://robo.phar/vendor/autoload.php';
10 if (!strpos(basename(__FILE__), 'phar')) {
11 if (file_exists(__DIR__.'/vendor/autoload.php')) {
12 $autoloaderPath = __DIR__.'/vendor/autoload.php';
13 } elseif (file_exists(__DIR__.'/../../autoload.php')) {
14 $autoloaderPath = __DIR__ . '/../../autoload.php';
17 $classLoader = require $autoloaderPath;
18 $configFilePath = getenv('ROBO_CONFIG') ?: getenv('HOME') . '/.robo/robo.yml';
19 $runner = new \Robo\Runner();
21 ->setRelativePluginNamespace('Robo\Plugin')
22 ->setSelfUpdateRepository('consolidation/robo')
23 ->setConfigurationFilename($configFilePath)
24 ->setEnvConfigPrefix('ROBO')
25 ->setClassLoader($classLoader);
26 $statusCode = $runner->execute($_SERVER['argv']);