本文整理匯總了PHP中Dog::getOrLoadUserByArg方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::getOrLoadUserByArg方法的具體用法?PHP Dog::getOrLoadUserByArg怎麽用?PHP Dog::getOrLoadUserByArg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dog
的用法示例。
在下文中一共展示了Dog::getOrLoadUserByArg方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% <user[!SID]>. Remove the password for a user.', 'removed' => 'The password for %s has been removed.'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc !== 1) {
$plugin->showHelp();
} elseif (false === ($user = Dog::getOrLoadUserByArg($argv[0]))) {
Dog::rply('err_user');
} else {
$user->saveVar('user_pass', NULL);
$plugin->rply('removed', array($user->displayName()));
}
示例2:
<?php
# :gizmore!gizmore@localhost KICK #sr Dog :gizmore
Dog::setupUser();
$server = Dog::getServer();
$channel = Dog::setupChannel();
if (false !== ($user = Dog::getOrLoadUserByArg(Dog::argv(1)))) {
$channel->removeUser($user);
}
if (Dog::getNickname() === $user->getName()) {
$server->removeChannel($channel);
}