本文整理汇总了PHP中Dog::getServerByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::getServerByID方法的具体用法?PHP Dog::getServerByID怎么用?PHP Dog::getServerByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog::getServerByID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% <URL|SID>. Join a server. URL format is ircs://irc.gizmore.org:6697.', 'err_url' => 'The URL is invalid.', 'connect' => 'Trying to connect.'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc !== 1) {
return $plugin->showHelp();
}
if (Common::isNumeric($argv[0]) && false !== ($server = Dog::getServerByID($argv[0]))) {
$prot = $server->isSSL() ? 'ircs' : 'irc';
$port = $server->getPort();
} else {
$url = parse_url($argv[0]);
if (!isset($url['host'])) {
return $plugin->rply('err_url');
}
$host = $url['host'];
$prot = isset($url['scheme']) ? strtolower($url['scheme']) : 'irc';
if ($prot !== 'irc' && $prot !== 'ircs') {
return $plugin->rply('err_url');
}
$default_port = $prot === 'ircs' ? 6697 : 6667;
$port = isset($url['port']) ? intval($url['port']) : $default_port;
$options = Dog_Server::DEFAULT_OPTIONS;
$options |= $prot === 'ircs' ? Dog_Server::SSL : 0;
}
if (false !== ($server = Dog::getServerByArg($argv[0])) || false !== ($server = Dog::getServerByArg($host))) {
$plugin->reply('reconnecting');
$server->saveOption(Dog_Server::ACTIVE, true);
$server->saveOption(Dog_Server::SSL, $prot === 'ircs');
示例2: initTimersDirServer
public static function initTimersDirServer($entry, $fullpath, $null = NULL)
{
if (false !== ($server = Dog_Server::getByTLD($entry))) {
if (false !== ($server = Dog::getServerByID($server->getID()))) {
GWF_File::filewalker($fullpath, true, array(__CLASS__, 'initTimersDir'), false, $server);
} else {
Dog_Log::debug(sprintf("Server %d-%s for Timer in path \"%s\" is not Online.", $serverid, $entry, $fullpath));
}
} else {
Dog_Log::debug(sprintf('Timer in path "%s" could not find it\'s server: %s.', $fullpath, $entry));
}
}
示例3: getUser
/**
* @return Dog_User
*/
public function getUser()
{
if (false === ($server = Dog::getServerByID($this->getSID()))) {
return false;
}
if (false !== ($user = $server->getUserByID($this->getUID()))) {
return $user;
}
return Dog_User::getByID($this->getUID());
// return $this->getVar('sr4pl_uid');
#XXX What the heck?
// $user = $this->getVar('sr4pl_uid');
// if (false !== ($server = Lamb::instance()->getServer($user->getVar('user_sid'))))
// {
// if (false !== ($u = $server->getUserByName($user->getVar('user_name'))))
// {
// return $u;
// }
// }
// return $user;
}
示例4: getServer
/**
* @return Dog_Server
*/
public function getServer()
{
return Dog::getServerByID($this->getSID());
}