X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fsmsqueuehandler.php;h=6583a77da85fa898950c40bad4d25bf56898084e;hb=254ea279d8c86ed25ed74bff036b16e6293571f7;hp=f17429d96318a093317b0cbc905da6835915b10b;hpb=edbc0c665cc65875b4d14b79939233b1c9c06bb6;p=quix0rs-gnu-social.git diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index f17429d963..6583a77da8 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.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 = <<log(LOG_INFO, "INITIALIZE"); return true; } - function handle_notice($notice) { + function handle_notice($notice) + { return mail_broadcast_notice_sms($notice); } - - function finish() { + + function finish() + { } } -ini_set("max_execution_time", "0"); -ini_set("max_input_time", "0"); -set_time_limit(0); -mb_internal_encoding('UTF-8'); - -$id = ($argc > 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 SmsQueueHandler($id);