本文整理匯總了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()));
}