[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/ssh/ -> PhabricatorSSHWorkflow.php (source)

   1  <?php
   2  
   3  abstract class PhabricatorSSHWorkflow extends PhabricatorManagementWorkflow {
   4  
   5    private $user;
   6    private $iochannel;
   7    private $errorChannel;
   8  
   9    public function isExecutable() {
  10      return false;
  11    }
  12  
  13    public function setErrorChannel(PhutilChannel $error_channel) {
  14      $this->errorChannel = $error_channel;
  15      return $this;
  16    }
  17  
  18    public function getErrorChannel() {
  19      return $this->errorChannel;
  20    }
  21  
  22    public function setUser(PhabricatorUser $user) {
  23      $this->user = $user;
  24      return $this;
  25    }
  26  
  27    public function getUser() {
  28      return $this->user;
  29    }
  30  
  31    public function setIOChannel(PhutilChannel $channel) {
  32      $this->iochannel = $channel;
  33      return $this;
  34    }
  35  
  36    public function getIOChannel() {
  37      return $this->iochannel;
  38    }
  39  
  40    public function readAllInput() {
  41      $channel = $this->getIOChannel();
  42      while ($channel->update()) {
  43        PhutilChannel::waitForAny(array($channel));
  44        if (!$channel->isOpenForReading()) {
  45          break;
  46        }
  47      }
  48      return $channel->read();
  49    }
  50  
  51    public function writeIO($data) {
  52      $this->getIOChannel()->write($data);
  53      return $this;
  54    }
  55  
  56    public function writeErrorIO($data) {
  57      $this->getErrorChannel()->write($data);
  58      return $this;
  59    }
  60  
  61    protected function newPassthruCommand() {
  62      return id(new PhabricatorSSHPassthruCommand())
  63        ->setErrorChannel($this->getErrorChannel());
  64    }
  65  
  66  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1