X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fpublicqueuehandler.php;h=701d50e0189f737ed36b41d4f90bcbcf2c23e5dc;hb=ec83890bc242650b169a524c373f488bb652265c;hp=b0fa22d438e6a66c0c3931e33965a739e4afe087;hpb=54795f2c41d1c19a441550146793ac63aed2f673;p=quix0rs-gnu-social.git diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index b0fa22d438..701d50e018 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -2,7 +2,7 @@ . */ -# 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();