本文整理匯總了PHP中IO::outOptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::outOptions方法的具體用法?PHP IO::outOptions怎麽用?PHP IO::outOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::outOptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cmdHelp
/**
* Встроенная комманда help реализует отображение справочной информации.
*
* Если передедан необязательный параметр $command отображается справка
* подкомманды.
*
* @param string $command
* @return int 0
*/
protected function cmdHelp($command = null)
{
$help = $this->parseHelpFile();
$subCommands = is_null($command) ? $this->getCommands() : array();
if (!is_null($command)) {
$help = $help['inclass'][$command];
}
IO::out($help['short']);
if (!empty($help['main'])) {
IO::out($help['main']);
}
$list = array();
foreach ($subCommands as $subCmd) {
$i = $this->getCommandInfo($subCmd);
$list[$subCmd] = trim($i['help']['short']);
}
if (isset($help['inclass']) && count($help['inclass'])) {
foreach ($help['inclass'] as $inCmd => $v) {
$list[$inCmd] = trim($v['short']);
}
}
if (count($list)) {
ksort($list, SORT_STRING);
IO::out("~WHITE~Commands~~~:");
IO::outOptions($list);
IO::out();
}
// Command Options
if (isset($help['options']) && count($help['options'])) {
io::out('~WHITE~Options~~~:');
io::outOptions($help['options']);
io::out();
}
// Common IO Help
IO::out(IO::help());
return 0;
}
示例2: cmdInfo
public function cmdInfo()
{
if (($login = ArgsHolder::get()->shiftCommand()) === false) {
return io::out('Incorrect param count', IO::MESSAGE_FAIL) | 1;
}
try {
$user = null;
if (is_numeric($login)) {
$user = User::findBy('id', $login);
} elseif (!($user = User::findBy('login', $login))) {
$user = User::findBy('email', $login);
}
if ($user) {
//$p=new Profile($id);
IO::out("");
IO::out("~WHITE~User Info~~~:");
$info = array('Id' => $user->getId(), 'Login' => $user->getLogin(), 'E-mail' => $user->getEmail(), 'State' => $user->getState() == "banned" ? '~RED~Banned~~~' : ($user->getState() == "active" ? '~GREEN~Active~~~' : '~CYAN~Deleted~~~'));
/*What is this ?
if (IO::getVerboseLevel()> IO::MESSAGE_TEXT){
$info[''] = '';
$info['~WHITE~CasseaUserManager~~~'] = '';
}*/
$info['Joined'] = $user->getDateJoined();
$info['Last seen'] = ($l = $user->getLastLogin()) != '0000-00-00 00:00:00' ? $l : 'never';
IO::outOptions($info);
//TODO SHow user profile
} else {
return io::out('There is no user ~WHITE~' . $login . '~~~', IO::MESSAGE_FAIL) | 2;
}
} catch (UserException $e) {
return io::out($e->getMessage(), IO::MESSAGE_FAIL) | 127;
}
}