X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fsmsqueuehandler.php;h=6583a77da85fa898950c40bad4d25bf56898084e;hb=10df75f9a074f2987b3525cd70a129bd26972ebb;hp=38f2f11febb4e6f812da9eb8f65d7a75348c481e;hpb=2d456a15e5652a0c0e2c0f9f50221eed2d16e109;p=quix0rs-gnu-social.git diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index 38f2f11feb..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 = << 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);