Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / management / PhabricatorRepositoryManagementPullWorkflow.php
blob5fd811e2104612094a5865c7b0cc3786053801d8
1 <?php
3 final class PhabricatorRepositoryManagementPullWorkflow
4 extends PhabricatorRepositoryManagementWorkflow {
6 protected function didConstruct() {
7 $this
8 ->setName('pull')
9 ->setExamples('**pull** __repository__ ...')
10 ->setSynopsis(pht('Pull __repository__.'))
11 ->setArguments(
12 array(
13 array(
14 'name' => 'verbose',
15 'help' => pht('Show additional debugging information.'),
17 array(
18 'name' => 'ignore-locality',
19 'help' => pht(
20 'Pull even if the repository should not be present on this '.
21 'host according to repository cluster configuration.'),
23 array(
24 'name' => 'repos',
25 'wildcard' => true,
27 ));
30 public function execute(PhutilArgumentParser $args) {
31 $ignore_locality = (bool)$args->getArg('ignore-locality');
33 $repos = $this->loadLocalRepositories($args, 'repos', $ignore_locality);
34 if (!$repos) {
35 throw new PhutilArgumentUsageException(
36 pht('Specify one or more repositories to pull.'));
39 $console = PhutilConsole::getConsole();
40 foreach ($repos as $repo) {
41 $console->writeOut(
42 "%s\n",
43 pht(
44 'Pulling "%s"...',
45 $repo->getDisplayName()));
47 id(new PhabricatorRepositoryPullEngine())
48 ->setRepository($repo)
49 ->setVerbose($args->getArg('verbose'))
50 ->pullRepository();
53 $console->writeOut("%s\n", pht('Done.'));
55 return 0;