本文整理汇总了PHP中Terminus::get_runner方法的典型用法代码示例。如果您正苦于以下问题:PHP Terminus::get_runner方法的具体用法?PHP Terminus::get_runner怎么用?PHP Terminus::get_runner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terminus
的用法示例。
在下文中一共展示了Terminus::get_runner方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: info
/**
* 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::get_runner();
$info = array('php_binary_path' => $php_bin, 'php_version' => PHP_VERSION, 'php_ini' => get_cfg_var('cfg_file_path'), 'global_config_path' => $runner->global_config_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', 'global_config_path' => 'Terminus global config', 'project_config_path' => 'Terminus project config', 'wp_cli_dir_path' => 'Terminus root dir', 'wp_cli_version' => 'Terminus version');
$this->output()->outputRecord($info, $labels);
}
示例2: info
/**
* 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::get_runner();
if (isset($assoc_args['format']) && 'json' === $assoc_args['format']) {
$info = array('php_binary_path' => $php_bin, 'global_config_path' => $runner->global_config_path, 'project_config_path' => $runner->project_config_path, 'wp_cli_dir_path' => TERMINUS_ROOT, 'wp_cli_version' => TERMINUS_VERSION);
Terminus::line(json_encode($info));
} else {
Terminus::line("PHP binary:\t" . $php_bin);
Terminus::line("PHP version:\t" . PHP_VERSION);
Terminus::line("php.ini used:\t" . get_cfg_var('cfg_file_path'));
Terminus::line("Terminus root dir:\t" . TERMINUS_ROOT);
Terminus::line("Terminus global config:\t" . $runner->global_config_path);
Terminus::line("Terminus project config:\t" . $runner->project_config_path);
Terminus::line("Terminus version:\t" . TERMINUS_VERSION);
}
}
示例3: get_command
private function get_command($words)
{
$positional_args = $assoc_args = array();
foreach ($words as $arg) {
if (preg_match('|^--([^=]+)=?|', $arg, $matches)) {
$assoc_args[$matches[1]] = true;
} else {
$positional_args[] = $arg;
}
}
$r = \Terminus::get_runner()->find_command_to_run($positional_args);
if (!is_array($r) && array_pop($positional_args) == $this->cur_word) {
$r = \Terminus::get_runner()->find_command_to_run($positional_args);
}
if (!is_array($r)) {
return $r;
}
list($command, $args) = $r;
return array($command, $args, $assoc_args);
}
示例4: explode
if (PHP_SAPI == 'cli' && isset($argv)) {
$source = explode('/', $argv[0]);
$source = end($source);
}
define('TERMINUS_SCRIPT', $source);
date_default_timezone_set('UTC');
include TERMINUS_ROOT . '/php/utils.php';
include TERMINUS_ROOT . '/php/FileCache.php';
include TERMINUS_ROOT . '/php/dispatcher.php';
include TERMINUS_ROOT . '/php/class-terminus.php';
include TERMINUS_ROOT . '/php/class-terminus-command.php';
\Terminus\Utils\load_dependencies();
//Set a custom exception handler
set_exception_handler('\\Terminus\\Utils\\handle_exception');
if (isset($_SERVER['TERMINUS_HOST']) && $_SERVER['TERMINUS_HOST'] != '') {
define('TERMINUS_HOST', $_SERVER['TERMINUS_HOST']);
} else {
define('TERMINUS_HOST', 'dashboard.getpantheon.com');
}
define('TERMINUS_PORT', '443');
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::get_runner()->run();
if (isset($_SERVER['VCR_CASSETTE'])) {
\VCR\VCR::eject();
\VCR\VCR::turnOff();
}