]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
save nickname and wildcard when setting up status network
authorEvan Prodromou <evan@status.net>
Sun, 24 Jan 2010 23:18:24 +0000 (18:18 -0500)
committerBrion Vibber <brion@pobox.com>
Mon, 25 Jan 2010 00:01:00 +0000 (16:01 -0800)
classes/Status_network.php

index ef8e1ed4314a91e9aa192bb2f9431c04543d1f96..445f8a5a3c5759e0c5a4b00ca1861ce85a9af5e3 100644 (file)
@@ -48,6 +48,7 @@ class Status_network extends DB_DataObject
 
     static $cache = null;
     static $base = null;
+    static $wildcard = null;
 
     /**
      * @param string $dbhost
@@ -187,7 +188,12 @@ class Status_network extends DB_DataObject
 
             $config['db']['database'] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname";
 
-            $config['site']['name']   = $sn->sitename;
+            $config['site']['name'] = $sn->sitename;
+            $config['site']['nickname'] = $sn->nickname;
+
+            self::$wildcard = $wildcard;
+
+            $config['site']['wildcard'] =& self::$wildcard;
 
             if (!empty($sn->hostname)) {
                 $config['site']['server'] = $sn->hostname;
@@ -230,4 +236,13 @@ class Status_network extends DB_DataObject
 
         exit;
     }
+
+    function getServerName()
+    {
+        if (!empty($this->hostname)) {
+            return $this->hostname;
+        } else {
+            return $this->nickname . '.' . self::$wildcard;
+        }
+    }
 }