]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Allow Meteor plugin to be configurable via configuration database or file.
authorBrion Vibber <brion@pobox.com>
Tue, 6 Apr 2010 21:07:46 +0000 (14:07 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 6 Apr 2010 21:07:46 +0000 (14:07 -0700)
As there's no admin control panel yet, this is mainly meant for batch administration and using setconfig.php

plugins/Meteor/MeteorPlugin.php

index 5b345d7c2fa339af694f7bcb5d613789992c46aa..5600d5fcc052b76bc8e2548fdbf509c0489625c9 100644 (file)
@@ -65,6 +65,26 @@ class MeteorPlugin extends RealtimePlugin
         parent::__construct();
     }
 
+    /**
+     * Pull settings from config file/database if set.
+     */
+    function initialize()
+    {
+        $settings = array('webserver',
+                          'webport',
+                          'controlport',
+                          'controlserver',
+                          'channelbase');
+        foreach ($settings as $name) {
+            $val = common_config('meteor', $name);
+            if ($val !== false) {
+                $this->$name = $val;
+            }
+        }
+
+        return parent::initialize();
+    }
+
     function _getScripts()
     {
         $scripts = parent::_getScripts();