本文整理汇总了PHP中Terminus::get_root_command方法的典型用法代码示例。如果您正苦于以下问题:PHP Terminus::get_root_command方法的具体用法?PHP Terminus::get_root_command怎么用?PHP Terminus::get_root_command使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terminus
的用法示例。
在下文中一共展示了Terminus::get_root_command方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_subcommand
private static function find_subcommand($args)
{
$command = \Terminus::get_root_command();
while (!empty($args) && $command && $command->can_have_subcommands()) {
$command = $command->find_subcommand($args);
}
return $command;
}
示例2: find_command_to_run
public function find_command_to_run($args)
{
$command = \Terminus::get_root_command();
$cmd_path = array();
while (!empty($args) && $command->can_have_subcommands()) {
$cmd_path[] = $args[0];
$full_name = implode(' ', $cmd_path);
$subcommand = $command->find_subcommand($args);
if (!$subcommand) {
return sprintf("'%s' is not a registered command. See 'terminus help'.", $full_name);
}
$command = $subcommand;
}
return array($command, $args, $cmd_path);
}
示例3: cmd_dump
/**
* Dump the list of installed commands, as JSON.
*
* @subcommand cmd-dump
*/
function cmd_dump()
{
$this->output()->outputDump(self::command_to_array(Terminus::get_root_command()));
}
示例4: cmd_dump
/**
* Dump the list of installed commands, as JSON.
*
* @subcommand cmd-dump
*/
function cmd_dump()
{
echo \Terminus\Utils\json_dump(self::command_to_array(Terminus::get_root_command()));
}