]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/enjitqueuehandler.php
move scripts to just before </body>, add event for scripts that need to be in <head>
[quix0rs-gnu-social.git] / scripts / enjitqueuehandler.php
index c17b4e27f4891e920888bd933723d51cedf95be0..08f733b07c5856041f5264642008463e7978a4d9 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env php
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -20,8 +20,8 @@
 
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
 
-$shortoptions = 'i';
-$longoptions = array('id');
+$shortoptions = 'i::';
+$longoptions = array('id::');
 
 $helptext = <<<END_OF_ENJIT_HELP
 Daemon script for watching new notices and posting to enjit.
@@ -120,15 +120,14 @@ class EnjitQueueHandler extends QueueHandler
 
 }
 
-mb_internal_encoding('UTF-8');
-
-$id = NULL;
-
-foreach ($options as $option) {
-    if ($option[0] == '--id' || $option[0] == '-i') {
-        $id = $option[1];
-        break;
-    }
+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);