[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/repository/management/ -> PhabricatorRepositoryManagementMirrorWorkflow.php (source)

   1  <?php
   2  
   3  final class PhabricatorRepositoryManagementMirrorWorkflow
   4    extends PhabricatorRepositoryManagementWorkflow {
   5  
   6    public function didConstruct() {
   7      $this
   8        ->setName('mirror')
   9        ->setExamples('**mirror** [__options__] __repository__ ...')
  10        ->setSynopsis(
  11          pht('Push __repository__, named by callsign, to mirrors.'))
  12        ->setArguments(
  13          array(
  14            array(
  15              'name'        => 'verbose',
  16              'help'        => pht('Show additional debugging information.'),
  17            ),
  18            array(
  19              'name'        => 'repos',
  20              'wildcard'    => true,
  21            ),
  22          ));
  23    }
  24  
  25    public function execute(PhutilArgumentParser $args) {
  26      $repos = $this->loadRepositories($args, 'repos');
  27  
  28      if (!$repos) {
  29        throw new PhutilArgumentUsageException(
  30          pht(
  31            'Specify one or more repositories to push to mirrors, by '.
  32            'callsign.'));
  33      }
  34  
  35      $console = PhutilConsole::getConsole();
  36      foreach ($repos as $repo) {
  37        $console->writeOut(
  38          "%s\n",
  39          pht('Pushing "%s" to mirrors...', $repo->getCallsign()));
  40  
  41        $engine = id(new PhabricatorRepositoryMirrorEngine())
  42          ->setRepository($repo)
  43          ->setVerbose($args->getArg('verbose'))
  44          ->pushToMirrors();
  45      }
  46  
  47      $console->writeOut("Done.\n");
  48  
  49      return 0;
  50    }
  51  
  52  }


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