Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / management / PhabricatorRepositoryManagementMirrorWorkflow.php
blobcaa7574424e69853bc01b658ddf1e8e54e48b25d
1 <?php
3 final class PhabricatorRepositoryManagementMirrorWorkflow
4 extends PhabricatorRepositoryManagementWorkflow {
6 protected function didConstruct() {
7 $this
8 ->setName('mirror')
9 ->setExamples('**mirror** [__options__] __repository__ ...')
10 ->setSynopsis(
11 pht('Push __repository__ to mirrors.'))
12 ->setArguments(
13 array(
14 array(
15 'name' => 'verbose',
16 'help' => pht('Show additional debugging information.'),
18 array(
19 'name' => 'repos',
20 'wildcard' => true,
22 ));
25 public function execute(PhutilArgumentParser $args) {
26 $repos = $this->loadLocalRepositories($args, 'repos');
28 if (!$repos) {
29 throw new PhutilArgumentUsageException(
30 pht(
31 'Specify one or more repositories to push to mirrors.'));
34 foreach ($repos as $repo) {
35 echo tsprintf(
36 "%s\n",
37 pht(
38 'Pushing "%s" to mirrors...',
39 $repo->getDisplayName()));
41 $engine = id(new PhabricatorRepositoryMirrorEngine())
42 ->setRepository($repo)
43 ->setVerbose($args->getArg('verbose'))
44 ->pushToMirrors();
47 echo tsprintf(
48 "%s\n",
49 pht('Done.'));
51 return 0;