From 6d63303f496c1265c27d3007bae6d80cf853775d Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 4 Apr 2012 17:54:57 +0300 Subject: Lots of experimental changes --- gsxcl2 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 gsxcl2 (limited to 'gsxcl2') diff --git a/gsxcl2 b/gsxcl2 new file mode 100755 index 0000000..83f1b41 --- /dev/null +++ b/gsxcl2 @@ -0,0 +1,55 @@ +#! /usr/bin/env php +getClient(); +$functions = $client->__getFunctions(); + +if($argv[8] == 'list') { + print_r($functions); + exit(); +} + +foreach($functions as $f) { + if(strstr($f, $api)) { + $valid = true; + } +} + +if(!$valid) { + exit(sprintf('Function "%s" is invalid', $api)); +} + +$params = json_decode($argv[8], TRUE); + +if($params === NULL) { + exit('Invalid params!'); +} + +$session = array('userSession' => array('userSessionId' => $gsx->getSessionId())); +$req = "{$api}Request"; + +if($api == 'CompTIACodes') { + $req = 'ComptiaCodeLookupRequest'; +} + +$request = array($req => array_merge($params, $session)); +$result = $client->$api($request); + +print_r($result); -- cgit v1.2.3