X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fpublicqueuehandler.php;h=50a11bcba03b26332e2009f94e678aea7ded1479;hb=a6d4adc398d9d2d131df97007452c5c54072ddec;hp=c0452cbee13ad7dd7260538d7825e2a672164147;hpb=29bebdb50bf008a02e6c3e9530b3dff3bdd2b821;p=quix0rs-gnu-social.git diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index c0452cbee1..50a11bcba0 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -1,8 +1,8 @@ #!/usr/bin/env php . */ -# Abort if called from a web server -if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { - print "This script must be run from the command line\n"; - exit(); -} - define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); -define('LACONICA', true); -require_once(INSTALLDIR . '/lib/common.php'); -require_once(INSTALLDIR . '/lib/jabber.php'); -require_once(INSTALLDIR . '/lib/xmppqueuehandler.php'); +$shortoptions = 'i::'; +$longoptions = array('id::'); + +$helptext = << 1) ? $argv[1] : (common_config('xmpp','resource') . '-public'); +if (have_option('i')) { + $id = get_option_value('i'); +} else if (have_option('--id')) { + $id = get_option_value('--id'); +} else if (count($args) > 0) { + $id = $args[0]; +} else { + $id = null; +} -$handler = new PublicQueueHandler($resource); +$handler = new PublicQueueHandler($id); $handler->runOnce();