Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/ssh/PhabricatorSSHWorkflow.php
| <?php | <?php | ||||
| abstract class PhabricatorSSHWorkflow | abstract class PhabricatorSSHWorkflow | ||||
| extends PhutilArgumentWorkflow { | extends PhutilArgumentWorkflow { | ||||
| // NOTE: We are explicitly extending "PhutilArgumentWorkflow", not | // NOTE: We are explicitly extending "PhutilArgumentWorkflow", not | ||||
| // "PhabricatorManagementWorkflow". We want to avoid inheriting "getViewer()" | // "PhabricatorManagementWorkflow". We want to avoid inheriting "getViewer()" | ||||
| // and other methods which assume workflows are administrative commands | // and other methods which assume workflows are administrative commands | ||||
| // like `bin/storage`. | // like `bin/storage`. | ||||
| private $sshUser; | private $sshUser; | ||||
| private $iochannel; | private $iochannel; | ||||
| private $errorChannel; | private $errorChannel; | ||||
| private $isClusterRequest; | private $isClusterRequest; | ||||
| private $originalArguments; | private $originalArguments; | ||||
| private $requestIdentifier; | |||||
| public function isExecutable() { | public function isExecutable() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function setErrorChannel(PhutilChannel $error_channel) { | public function setErrorChannel(PhutilChannel $error_channel) { | ||||
| $this->errorChannel = $error_channel; | $this->errorChannel = $error_channel; | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | public function setOriginalArguments(array $original_arguments) { | ||||
| $this->originalArguments = $original_arguments; | $this->originalArguments = $original_arguments; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getOriginalArguments() { | public function getOriginalArguments() { | ||||
| return $this->originalArguments; | return $this->originalArguments; | ||||
| } | } | ||||
| public function setRequestIdentifier($request_identifier) { | |||||
| $this->requestIdentifier = $request_identifier; | |||||
| return $this; | |||||
| } | |||||
| public function getRequestIdentifier() { | |||||
| return $this->requestIdentifier; | |||||
| } | |||||
| public function getSSHRemoteAddress() { | public function getSSHRemoteAddress() { | ||||
| $ssh_client = getenv('SSH_CLIENT'); | $ssh_client = getenv('SSH_CLIENT'); | ||||
| if (!strlen($ssh_client)) { | if (!strlen($ssh_client)) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| // TODO: When commands are proxied, the original remote address should | // TODO: When commands are proxied, the original remote address should | ||||
| // also be proxied. | // also be proxied. | ||||
| Show All 14 Lines | |||||