From: Evan Prodromou Date: Sun, 28 Jun 2009 20:13:08 +0000 (-0400) Subject: xmppdaemon.php can stay in foreground X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=47e1d2adb87ae8ffa4c954d3ba62da64e986696c;p=quix0rs-gnu-social.git xmppdaemon.php can stay in foreground --- diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 3eecfec29a..38d739e680 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -20,13 +20,14 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); -$shortoptions = 'i::'; -$longoptions = array('id::'); +$shortoptions = 'fi::'; +$longoptions = array('id::', 'foreground'); $helptext = <<host) ? $this->host : $this->server; $this->log(LOG_INFO, "Connecting to $connect_to on port $this->port"); @@ -323,16 +325,16 @@ if (common_config('xmpp','enabled')==false) { exit(); } -if (have_option('i')) { - $id = get_option_value('i'); -} else if (have_option('--id')) { - $id = get_option_value('--id'); +if (have_option('i', 'id')) { + $id = get_option_value('i', 'id'); } else if (count($args) > 0) { $id = $args[0]; } else { $id = null; } -$daemon = new XMPPDaemon($id); +$foreground = have_option('f', 'foreground'); + +$daemon = new XMPPDaemon($id, $foreground); $daemon->runOnce();