Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/ssh/ConduitSSHWorkflow.php
| Show All 12 Lines | $this->setArguments( | ||||
| )); | )); | ||||
| } | } | ||||
| public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
| $time_start = microtime(true); | $time_start = microtime(true); | ||||
| $methodv = $args->getArg('method'); | $methodv = $args->getArg('method'); | ||||
| if (!$methodv) { | 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 = json_decode($json, true); | ||||
| if (!is_array($raw_params)) { | if (!is_array($raw_params)) { | ||||
| throw new Exception("Invalid JSON input."); | throw new Exception('Invalid JSON input.'); | ||||
| } | } | ||||
| $params = idx($raw_params, 'params', '[]'); | $params = idx($raw_params, 'params', '[]'); | ||||
| $params = json_decode($params, true); | $params = json_decode($params, true); | ||||
| $metadata = idx($params, '__conduit__', array()); | $metadata = idx($params, '__conduit__', array()); | ||||
| unset($params['__conduit__']); | unset($params['__conduit__']); | ||||
| $call = null; | $call = null; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||