From: Brion Vibber Date: Tue, 6 Apr 2010 21:07:46 +0000 (-0700) Subject: Allow Meteor plugin to be configurable via configuration database or file. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7c3b320a7a28cdc6fcab9b5c4854bba0775d6ec2;p=quix0rs-gnu-social.git Allow Meteor plugin to be configurable via configuration database or file. As there's no admin control panel yet, this is mainly meant for batch administration and using setconfig.php --- diff --git a/plugins/Meteor/MeteorPlugin.php b/plugins/Meteor/MeteorPlugin.php index 5b345d7c2f..5600d5fcc0 100644 --- a/plugins/Meteor/MeteorPlugin.php +++ b/plugins/Meteor/MeteorPlugin.php @@ -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();