X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fpingqueuehandler.php;h=c92337e36c6ebb75b14caf8dbda786f80309691e;hb=4024a5ee65839d79d788d58b4fdd96893fe96360;hp=55a266e4a43a1a21c0f0b03c64198a9cc604accb;hpb=13c183e2f4e0738233658ca79103bbe4a6d57992;p=quix0rs-gnu-social.git diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php index 55a266e4a4..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);