Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Robo Runner #1179

Merged
merged 3 commits into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 30 additions & 3 deletions bin/terminus.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/../vendor/autoload.php';
$phar_path = \Phar::running(true);
if ($phar_path) {
include_once "$phar_path/vendor/autoload.php";
} else {
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
include_once __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../autoload.php')) {
include_once __DIR__ . '/../../autoload.php';
}
}

use League\Container\Container;
use Pantheon\Terminus\Config;
use Pantheon\Terminus\Runner;
use Pantheon\Terminus\Terminus;
use Robo\Robo;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

$runner = new Runner();
$runner->run();
// Initializing the Terminus application
$config = new Config();
$application = new Terminus('Terminus', $config->get('version'), $config);

// Configuring the dependency-injection container
$container = new Container();
$input = new ArgvInput($_SERVER['argv']);
$output = new ConsoleOutput();
Robo::configureContainer($container, $input, $output, $application);

// Running Terminus
$runner = new Runner($container);
$status_code = $runner->run($input, $output);
exit($status_code);