本文整理汇总了PHP中Dog::removeServer方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::removeServer方法的具体用法?PHP Dog::removeServer怎么用?PHP Dog::removeServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog::removeServer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% [<server>]. Command %BOT% to quit a server.', 'ok' => 'Disconnecting from %s...', 'msg' => '%s executed %CMD%!'));
$plugin = Dog::getPlugin();
$user = Dog::getUser();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc === 0) {
$server = Dog::getServer();
} elseif ($argc === 1) {
if (false === ($server = Dog::getServerByArg($argv[0]))) {
return Dog::rply('err_server');
}
} else {
return $plugin->showHelp();
}
$server->saveOption(Dog_Server::ACTIVE, false);
$plugin->rply('ok', array($server->displayLongName()));
$server->disconnect($plugin->lang('msg', array($user->displayName())));
if (!$server->hasConnectedOnce()) {
Dog::removeServer($server);
$server->delete();
}
示例2: connect
public function connect()
{
if ($this->next_connect <= microtime(true)) {
$this->attempt++;
echo "Dog_IRC::connect() to {$this->getURL()}{$this->displaySSL()} attempt {$this->attempt}.\n";
if (false === $this->connection->connect($this)) {
$this->setConnectIn($this->getNextConnectTime());
if (false !== ($connector = $this->getVarDefault('dog_connector', false))) {
$connector instanceof Dog_User;
$connector->sendPRIVMSG(Dog::lang('err_connecting', array($this->displayLongName())));
}
if ($this->attempt > 3 && !$this->hasConnectedOnce()) {
Dog::removeServer($this);
$this->delete();
}
return false;
} else {
$this->attempt = 2;
return Dog_Auth::connect($this);
}
}
}