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