[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/diffusion/ssh/ -> DiffusionSSHGitReceivePackWorkflow.php (source)

   1  <?php
   2  
   3  final class DiffusionSSHGitReceivePackWorkflow
   4    extends DiffusionSSHGitWorkflow {
   5  
   6    public function didConstruct() {
   7      $this->setName('git-receive-pack');
   8      $this->setArguments(
   9        array(
  10          array(
  11            'name'      => 'dir',
  12            'wildcard'  => true,
  13          ),
  14        ));
  15    }
  16  
  17    protected function executeRepositoryOperations() {
  18      $args = $this->getArgs();
  19      $path = head($args->getArg('dir'));
  20      $repository = $this->loadRepository($path);
  21  
  22      // This is a write, and must have write access.
  23      $this->requireWriteAccess();
  24  
  25      $command = csprintf('git-receive-pack %s', $repository->getLocalPath());
  26      $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command);
  27  
  28      $future = id(new ExecFuture('%C', $command))
  29        ->setEnv($this->getEnvironment());
  30  
  31      $err = $this->newPassthruCommand()
  32        ->setIOChannel($this->getIOChannel())
  33        ->setCommandChannelFromExecFuture($future)
  34        ->execute();
  35  
  36      if (!$err) {
  37        $repository->writeStatusMessage(
  38          PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE,
  39          PhabricatorRepositoryStatusMessage::CODE_OKAY);
  40        $this->waitForGitClient();
  41      }
  42  
  43      return $err;
  44    }
  45  
  46  }


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