X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Ffacebookqueuehandler.php;h=e13ac4e85092155080af70d0b69d905c1a33f5d8;hb=fc61b7162576deb11a7947a8a04293b744f9d5fc;hp=c6859cb219121f10b4885b277f94702ed7005a9b;hpb=d014d43c6860e3aaf46a5afba0ea3dffd54f630d;p=quix0rs-gnu-social.git diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php index c6859cb219..e13ac4e850 100755 --- a/scripts/facebookqueuehandler.php +++ b/scripts/facebookqueuehandler.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/facebookutil.php'); -require_once(INSTALLDIR . '/lib/queuehandler.php'); +$shortoptions = 'i::'; +$longoptions = array('id::'); + +$helptext = <<log(LOG_INFO, "INITIALIZE"); @@ -51,20 +52,22 @@ class FacebookQueueHandler extends QueueHandler { return facebookBroadcastNotice($notice); } - + 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 FacebookQueueHandler($id);