当前位置: 首页>>代码示例>>PHP>>正文


PHP Terminus::get_runner方法代码示例

本文整理汇总了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);
 }
开发者ID:nataliejeremy,项目名称:cli,代码行数:16,代码来源:cli.php

示例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);
     }
 }
开发者ID:skyywalk3rr,项目名称:cli,代码行数:25,代码来源:cli.php

示例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);
 }
开发者ID:mikevanwinkle,项目名称:cli,代码行数:20,代码来源:Completions.php

示例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();
}
开发者ID:reynoldsalec,项目名称:cli,代码行数:31,代码来源:terminus.php


注:本文中的Terminus::get_runner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。