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