all daemons take an id parameter

This commit is contained in:
Evan Prodromou
2009-06-24 19:31:12 -07:00
parent a6c56d17e0
commit becfd6b3b5
5 changed files with 45 additions and 46 deletions

View File

@@ -20,13 +20,13 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'r::';
$longoptions = array('resource::');
$shortoptions = 'i::';
$longoptions = array('id::');
$helptext = <<<END_OF_JABBER_HELP
Daemon script for pushing new notices to Jabber users.
-r --resource Jabber Resource ID (default to config)
-i --id Identity (default none)
END_OF_JABBER_HELP;
@@ -63,16 +63,16 @@ if (common_config('xmpp','enabled')==false) {
exit();
}
if (have_option('r')) {
$resource = get_option_value('r');
} else if (have_option('--resource')) {
$resource = get_option_value('--resource');
if (have_option('i')) {
$id = get_option_value('i');
} else if (have_option('--id')) {
$id = get_option_value('--id');
} else if (count($args) > 0) {
$resource = $args[0];
$id = $args[0];
} else {
$resource = null;
$id = null;
}
$handler = new JabberQueueHandler($resource);
$handler = new JabberQueueHandler($id);
$handler->runOnce();