function checkSchema()
 {
     $config = $this->getConfig();
     Status_network::$wildcard = $config['WILDCARD'];
     GNUsocial::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');
 }
예제 #2
0
 /**
  * Switch site, if necessary, and reset current handler assignments
  * @param string $site
  */
 function switchSite($site)
 {
     if ($site != GNUsocial::currentSite()) {
         $this->stats('switch');
         GNUsocial::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));
     }
     GNUsocial::switchSite($sn->nickname);
     $user = User::getKV('email', $email);
     if (empty($user)) {
         throw new ClientException(_('No such user.'));
     }
 }