X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fpublicqueuehandler.php;h=c10c679108974b3666f9557432bedf419fe933ba;hb=d6bd6bb441d55182a02e92eceb650cea6df837d8;hp=5075c12df578aeeec4f45ce8db0bc430902dfe6f;hpb=02877224b20f87af304553f739b69544d7ac4cfa;p=quix0rs-gnu-social.git diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index 5075c12df5..c10c679108 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 = 'r'; +$longoptions = array('resource'); + +$helptext = << 1) ? $argv[1] : (common_config('xmpp','resource') . '-public'); +if (have_option('-r')) { + $resource = get_option_value('-r'); +} else if (have_option('--resource')) { + $resource = get_option_value('--resource'); +} else if (count($args) > 0) { + $resource = $args[0]; +} else { + $resource = null; +} $handler = new PublicQueueHandler($resource);