]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/DomainStatusNetwork/lib/domainstatusnetworkinstaller.php
Merge branch 'statusnetworkapi' into 1.0.x
[quix0rs-gnu-social.git] / plugins / DomainStatusNetwork / lib / domainstatusnetworkinstaller.php
index b2042abe947630542cd227665526dde0183ece42..b2e988b5e1eca1c9521ea3de318ebee7014ecf71 100644 (file)
@@ -120,6 +120,14 @@ class DomainStatusNetworkInstaller extends Installer
         $this->sitehost = $config['DBHOST'];
         $this->sitedb   = $config['SITEDB'];
 
+        $tagstr = $config['TAGS'];
+
+        if (!empty($tagstr)) {
+            $this->tags = preg_split('/[\s,]+/', $tagstr);
+        } else {
+            $this->tags = array();
+        }
+
         // Explicitly empty
 
         $this->adminNick    = null;
@@ -185,7 +193,15 @@ class DomainStatusNetworkInstaller extends Installer
             throw new ServerException("Created {$this->nickname} status_network and could not find it again.");
         }
 
-        $sn->setTags(array('domain='.$this->domain));
+        // Set default tags
+
+        $tags = $this->tags;
+
+        // Add domain tag
+
+        $tags[] = 'domain='.$this->domain;
+
+        $sn->setTags($tags);
 
         $this->sn = $sn;
     }
@@ -198,6 +214,21 @@ class DomainStatusNetworkInstaller extends Installer
 
         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');
     }