Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistCallConduitWorkflow.php
| Show All 38 Lines | EOTEXT | ||||
| public function runWorkflow() { | public function runWorkflow() { | ||||
| $method = $this->getArgument('method'); | $method = $this->getArgument('method'); | ||||
| if (count($method) !== 1) { | if (count($method) !== 1) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht('Provide exactly one Conduit method name to call.')); | pht('Provide exactly one Conduit method name to call.')); | ||||
| } | } | ||||
| $method = head($method); | $method = head($method); | ||||
| if (phutil_is_interactive()) { | $params = $this->readStdin(); | ||||
| echo tsprintf( | |||||
| "%s\n", | |||||
| pht('Waiting for JSON parameters on stdin...')); | |||||
| } | |||||
| $params = @file_get_contents('php://stdin'); | |||||
| try { | try { | ||||
| $params = phutil_json_decode($params); | $params = phutil_json_decode($params); | ||||
| } catch (PhutilJSONParserException $ex) { | } catch (PhutilJSONParserException $ex) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| pht('Provide method parameters on stdin as a JSON blob.')); | pht('Provide method parameters on stdin as a JSON blob.')); | ||||
| } | } | ||||
| $engine = $this->getConduitEngine(); | $engine = $this->getConduitEngine(); | ||||
| Show All 24 Lines | |||||