Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / management / PhabricatorRepositoryManagementRefsWorkflow.php
blob8d3062195cfc2b3192d73277de4d6baafe05cc30
1 <?php
3 final class PhabricatorRepositoryManagementRefsWorkflow
4 extends PhabricatorRepositoryManagementWorkflow {
6 protected function didConstruct() {
7 $this
8 ->setName('refs')
9 ->setExamples('**refs** [__options__] __repository__ ...')
10 ->setSynopsis(pht('Update refs in __repository__.'))
11 ->setArguments(
12 array(
13 array(
14 'name' => 'verbose',
15 'help' => pht('Show additional debugging information.'),
17 array(
18 'name' => 'rebuild',
19 'help' => pht(
20 'Publish commits currently reachable from any permanent ref, '.
21 'ignoring the cached ref state.'),
23 array(
24 'name' => 'repos',
25 'wildcard' => true,
27 ));
30 public function execute(PhutilArgumentParser $args) {
31 $repos = $this->loadLocalRepositories($args, 'repos');
33 if (!$repos) {
34 throw new PhutilArgumentUsageException(
35 pht(
36 'Specify one or more repositories to update refs for.'));
39 $console = PhutilConsole::getConsole();
40 foreach ($repos as $repo) {
41 $console->writeOut(
42 "%s\n",
43 pht(
44 'Updating refs in "%s"...',
45 $repo->getDisplayName()));
47 $engine = id(new PhabricatorRepositoryRefEngine())
48 ->setRepository($repo)
49 ->setVerbose($args->getArg('verbose'))
50 ->setRebuild($args->getArg('rebuild'))
51 ->updateRefs();
54 $console->writeOut("%s\n", pht('Done.'));
56 return 0;