Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/ssh/ConduitSSHWorkflow.php
| Show All 20 Lines | if (!$methodv) { | ||||
| throw new Exception('No Conduit method provided.'); | throw new Exception('No Conduit method provided.'); | ||||
| } else if (count($methodv) > 1) { | } else if (count($methodv) > 1) { | ||||
| throw new Exception('Too many Conduit methods provided.'); | throw new Exception('Too many Conduit methods provided.'); | ||||
| } | } | ||||
| $method = head($methodv); | $method = head($methodv); | ||||
| $json = $this->readAllInput(); | $json = $this->readAllInput(); | ||||
| $raw_params = json_decode($json, true); | $raw_params = null; | ||||
| if (!is_array($raw_params)) { | try { | ||||
| throw new Exception('Invalid JSON input.'); | $raw_params = phutil_json_decode($json); | ||||
| } catch (PhutilJSONParserException $ex) { | |||||
| throw new PhutilProxyException( | |||||
| pht('Invalid JSON input.'), | |||||
| $ex); | |||||
| } | } | ||||
| $params = idx($raw_params, 'params', '[]'); | $params = idx($raw_params, 'params', '[]'); | ||||
| $params = json_decode($params, true); | $params = phutil_json_decode($params); | ||||
| $metadata = idx($params, '__conduit__', array()); | $metadata = idx($params, '__conduit__', array()); | ||||
| unset($params['__conduit__']); | unset($params['__conduit__']); | ||||
| $call = null; | $call = null; | ||||
| $error_code = null; | $error_code = null; | ||||
| $error_info = null; | $error_info = null; | ||||
| try { | try { | ||||
| Show All 40 Lines | |||||