本文整理汇总了PHP中PEAR_Command::getShortcuts方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Command::getShortcuts方法的具体用法?PHP PEAR_Command::getShortcuts怎么用?PHP PEAR_Command::getShortcuts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_Command
的用法示例。
在下文中一共展示了PEAR_Command::getShortcuts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmdHelp
function cmdHelp($command)
{
global $progname, $all_commands, $config;
if ($command == "options") {
return "Options:\n" . " -v increase verbosity level (default 1)\n" . " -q be quiet, decrease verbosity level\n" . " -c file find user configuration in `file'\n" . " -C file find system configuration in `file'\n" . " -d foo=bar set user config variable `foo' to `bar'\n" . " -D foo=bar set system config variable `foo' to `bar'\n" . " -G start in graphical (Gtk) mode\n" . " -s store user configuration\n" . " -S store system configuration\n" . " -u foo unset `foo' in the user configuration\n" . " -h, -? display help/usage (this message)\n" . " -V version information\n";
} elseif ($command == "shortcuts") {
$sc = PEAR_Command::getShortcuts();
$ret = "Shortcuts:\n";
foreach ($sc as $s => $c) {
$ret .= sprintf(" %-8s %s\n", $s, $c);
}
return $ret;
} elseif ($command == "version") {
return "PEAR Version: " . $GLOBALS['pear_package_version'] . "\nPHP Version: " . phpversion() . "\nZend Engine Version: " . zend_version() . "\nRunning on: " . php_uname();
} elseif ($help = PEAR_Command::getHelp($command)) {
if (is_string($help)) {
return "{$progname} {$command} [options] {$help}\n";
}
if ($help[1] === null) {
return "{$progname} {$command} {$help['0']}";
} else {
return "{$progname} {$command} [options] {$help['0']}\n{$help['1']}";
}
}
return "Command '{$command}' is not valid, try 'pear help'";
}