summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'get.php')
-rw-r--r--get.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/get.php b/get.php
index d816573..0338ccb 100644
--- a/get.php
+++ b/get.php
@@ -1,4 +1,17 @@
<?php
+
+ /** Allows the use of get.php as an CLI tool **/
+ /** Example: php -e get.php m=IATI,3DIS g=M1_INFO **/
+ /** Patch by Mael Valais **/
+ if (php_sapi_name() == "cli")
+ {
+ for ($c = 1; $c < $argc; $c++)
+ {
+ $param = explode("=", $argv[$c], 2);
+ $_GET[$param[0]] = $param[1]; // $_GET['name1'] = 'value1
+ }
+ }
+
header('Content-Type: text/calendar; charset=UTF-8');
$group = $_GET["g"];