/** * Make sure we're on the right site configuration */ protected function switchSite() { if ($this->site != StatusNet::currentSite()) { common_log(LOG_DEBUG, __METHOD__ . ": switching to site {$this->site}"); $this->stats('switch'); StatusNet::switchSite($this->site); } }
/** * Switch site, if necessary, and reset current handler assignments * @param string $site */ function switchSite($site) { if ($site != StatusNet::currentSite()) { $this->stats('switch'); StatusNet::switchSite($site); $this->initialize(); } }
static function recoverPassword($email) { $domain = self::toDomain($email); $sn = self::siteForDomain($domain); if (empty($sn)) { throw new NoSuchUserException(array('email' => $email)); } StatusNet::switchSite($sn->nickname); $user = User::staticGet('email', $email); if (empty($user)) { throw new ClientException(_('No such user.')); } }
function checkSchema() { $config = $this->getConfig(); Status_network::$wildcard = $config['WILDCARD']; StatusNet::switchSite($this->nickname); // We need to initialize the schema_version stuff to make later setup easier $schema = array(); require INSTALLDIR . '/db/core.php'; $tableDefs = $schema; $schema = Schema::get(); $schemaUpdater = new SchemaUpdater($schema); foreach ($tableDefs as $table => $def) { $schemaUpdater->register($table, $def); } $schemaUpdater->checkSchema(); Event::handle('CheckSchema'); }