예제 #1
0
파일: cli.php 프로젝트: RobLoach/cli
 /**
  * Print various data about the CLI environment.
  *
  * ## OPTIONS
  *
  * [--format=<format>]
  * : Accepted values: json
  */
 function info($_, $assoc_args)
 {
     $php_bin = defined('PHP_BINARY') ? PHP_BINARY : getenv('TERMINUS_PHP_USED');
     $runner = Terminus::getRunner();
     $info = array('php_binary_path' => $php_bin, 'php_version' => PHP_VERSION, 'php_ini' => get_cfg_var('cfg_file_path'), 'project_config_path' => $runner->project_config_path, 'wp_cli_dir_path' => TERMINUS_ROOT, 'wp_cli_version' => TERMINUS_VERSION);
     $labels = array('php_binary_path' => 'PHP binary', 'php_version' => 'PHP version', 'php_ini' => 'php.ini used', 'project_config_path' => 'Terminus project config', 'wp_cli_dir_path' => 'Terminus root dir', 'wp_cli_version' => 'Terminus version');
     $this->output()->outputRecord($info, $labels);
 }
예제 #2
0
 public function testRunCommand()
 {
     $runner = \Terminus::getRunner();
     $this->assertInstanceOf('Terminus\\Runner', $runner);
     $args = array('site');
     $assoc_args = array('site' => 'phpunittest');
     $return = $runner->runCommand($args, $assoc_args);
     $this->assertNull($return);
 }
예제 #3
0
 public function testGetRunner()
 {
     $runner = Terminus::getRunner();
     $this->assertTrue(strpos(get_class($runner), 'Runner') !== false);
 }
예제 #4
0
파일: terminus.php 프로젝트: bjargud/cli
    $env = new Dotenv\Dotenv(getcwd());
    $env->load();
}
//Set a custom exception handler
//set_exception_handler('\Terminus\Utils\handle_exception');
$host = 'dashboard.pantheon.io';
if (isset($_SERVER['TERMINUS_HOST']) && $_SERVER['TERMINUS_HOST'] != '') {
    $host = $_SERVER['TERMINUS_HOST'];
}
define('TERMINUS_HOST', $host);
$port = 443;
if (isset($_SERVER['TERMINUS_PORT']) && $_SERVER['TERMINUS_PORT'] != '') {
    $port = $_SERVER['TERMINUS_PORT'];
}
define('TERMINUS_PORT', $port);
$protocol = 'https';
if (isset($_SERVER['TERMINUS_PROTOCOL']) && $_SERVER['TERMINUS_PROTOCOL'] != '') {
    $protocol = $_SERVER['TERMINUS_PROTOCOL'];
}
define('TERMINUS_PROTOCOL', $protocol);
if (isset($_SERVER['VCR_CASSETTE'])) {
    \VCR\VCR::configure()->enableRequestMatchers(array('method', 'url', 'body'));
    \VCR\VCR::configure()->setMode($_SERVER['VCR_MODE']);
    \VCR\VCR::turnOn();
    \VCR\VCR::insertCassette($_SERVER['VCR_CASSETTE']);
}
Terminus::getRunner()->run();
if (isset($_SERVER['VCR_CASSETTE'])) {
    \VCR\VCR::eject();
    \VCR\VCR::turnOff();
}