X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fpingqueuehandler.php;h=c92337e36c6ebb75b14caf8dbda786f80309691e;hb=5d09b6b3f0595540c66b703ae085f0af904fe30f;hp=ada6ecdba2070f20ad9a865553fdca2543df15ec;hpb=e7c57b43073888d18760e2411b207a4ee2cf508b;p=quix0rs-gnu-social.git diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php index ada6ecdba2..c92337e36c 100644 --- a/scripts/pingqueuehandler.php +++ b/scripts/pingqueuehandler.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/ping.php'); -require_once(INSTALLDIR . '/lib/queuehandler.php'); +$shortoptions = 'i::'; +$longoptions = array('id::'); + +$helptext = << 1) ? $argv[1] : NULL; +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 PingQueueHandler($id);