X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fenjitqueuehandler.php;h=08f733b07c5856041f5264642008463e7978a4d9;hb=10df75f9a074f2987b3525cd70a129bd26972ebb;hp=40f60da5d80996fc19901c61546fc91be72e57ba;hpb=a3d5e00f64b3c166e34a8d36fcb4f5b757394e9b;p=quix0rs-gnu-social.git diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 40f60da5d8..08f733b07c 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.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/mail.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 EnjitQueueHandler($id);