本文整理汇总了PHP中Terminus::getRootCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP Terminus::getRootCommand方法的具体用法?PHP Terminus::getRootCommand怎么用?PHP Terminus::getRootCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terminus
的用法示例。
在下文中一共展示了Terminus::getRootCommand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findSubcommand
private static function findSubcommand($args)
{
$command = \Terminus::getRootCommand();
while (!empty($args) && $command && $command->canHaveSubcommands()) {
$command = $command->findSubcommand($args);
}
return $command;
}
示例2: testGetRootCommand
public function testGetRootCommand()
{
$root_command = Terminus::getRootCommand();
$this->assertTrue(strpos(get_class($root_command), 'RootCommand') !== false);
// Make sure the core commands have loaded
$commands = array('art', 'auth', 'cli', 'drush', 'help', 'machine-tokens', 'organizations', 'site', 'sites', 'upstreams', 'workflows', 'wp');
foreach ($commands as $command) {
$args = array($command);
$this->assertTrue($root_command->findSubcommand($args) !== false);
}
// Make sure the correct number of parameters are configured.
$desc = $root_command->getLongdesc();
$this->assertTrue(count($desc['parameters']) == 4);
}
示例3: testGetPath
public function testGetPath()
{
$root_command = Terminus::getRootCommand();
$path = Dispatcher\getPath($root_command);
$this->assertEquals($path, ['terminus']);
}
示例4: cmd_dump
/**
* Dump the list of installed commands, as JSON.
*
* @subcommand cmd-dump
*/
function cmd_dump()
{
$this->output()->outputDump(self::command_to_array(Terminus::getRootCommand()));
}
示例5: testGetRootCommand
public function testGetRootCommand()
{
$root_command = Terminus::getRootCommand();
$this->assertTrue(strpos(get_class($root_command), 'RootCommand') !== false);
}