public static function connect(Dog_Server $server) { if (false === ($nick = self::getNickData($server))) { return Dog_Log::warn(sprintf('No nicks for %s.', $server->displayName())); } $server->addUser(Dog::getOrCreateUserByName($nick->getName())); $conn = $server->getConnection(); return self::sendUser($conn, $server, $nick) && self::sendNick($conn, $server, $nick); }
private static function initModulesDir($dir) { if (false === ($files = @scandir(DOG_PATH . 'dog_modules/' . $dir))) { return Dog_Log::warn('Dog_Init::initModulesDir() - Directory not found: ' . (DOG_PATH . 'dog_modules/' . $dir)); } foreach ($files as $filename) { if ($filename[0] !== '.') { $path = DOG_PATH . 'dog_modules/' . $dir . '/' . $filename; if (Common::isDir($path)) { $modf = $path . '/DOGMOD_' . $filename . '.php'; require_once $modf; Dog_Module::createModule($path . '/', $filename); } } } }
public function setLogging($mode) { if ($mode === NULL) { return $this->saveOption(self::LOGBITS, false); } elseif ($mode === 1) { return $this->saveOption(self::LOGGING_ON, true) && $this->saveOption(self::LOGGING_OFF, false); } elseif ($mode === 0) { return $this->saveOption(self::LOGGING_ON, false) && $this->saveOption(self::LOGGING_OFF, true); } else { return Dog_Log::warn('Invalid logging mode in Server->setLogging: ' . $mode); } }
<?php # :irc.giz.org 403 Dog sr :Invalid channel name Dog_Log::warn('Invalid channel name: ' . Dog::argv(1));
private function onBoardTimer(Dog_Forum $board) { if (false === ($entries = $board->fetchNewEntries(10))) { return Dog_Log::warn('Forum Board Activities corrupt!'); } if (count($entries) > 0) { foreach (Dog::getServers() as $server) { $this->onBoardServerTimer($entries, $board, $server); } $board->updateDatestamp(array_pop($entries)); } }