diff options
author | Simon Rettberg | 2017-05-12 17:09:47 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-05-12 17:09:47 +0200 |
commit | 29a0edd72883e6e9956cb9abf81b159e81db3a44 (patch) | |
tree | 81ca7ee6ef39f6425fa00477c20f150ceb68521f /api.php | |
parent | [locationinfo] Tweak and clean up overview panel (diff) | |
download | slx-admin-29a0edd72883e6e9956cb9abf81b159e81db3a44.tar.gz slx-admin-29a0edd72883e6e9956cb9abf81b159e81db3a44.tar.xz slx-admin-29a0edd72883e6e9956cb9abf81b159e81db3a44.zip |
API: Put parameters into $_GET in cli-mode
Format is --key value --anotherkey anothervalue ...
Diffstat (limited to 'api.php')
-rw-r--r-- | api.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -28,6 +28,13 @@ if (!empty($_REQUEST['do'])) { $module = preg_replace('/[^a-z]/', '', $_REQUEST['do']); } elseif (!empty($argv[1])) { $module = preg_replace('/[^a-z]/', '', $argv[1]); + $argc = count($argv) - 1; + for ($i = 2; $i < $argc; ++$i) { + if (substr($argv[$i], 0, 2) === '--') { + $_GET[substr($argv[$i], 2)] = $argv[$i+1]; + ++$i; + } + } } else { exit(1); } |