Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class PhabricatorRepositoryManagementRefsWorkflow extends PhabricatorReposi..

Decoded Output download

<?php

final class PhabricatorRepositoryManagementRefsWorkflow
  extends PhabricatorRepositoryManagementWorkflow {

  protected function didConstruct() {
    $this
      ->setName('refs')
      ->setExamples('**refs** [__options__] __repository__ ...')
      ->setSynopsis(pht('Update refs in __repository__.'))
      ->setArguments(
        array(
          array(
            'name'        => 'verbose',
            'help'        => pht('Show additional debugging information.'),
          ),
          array(
            'name' => 'rebuild',
            'help' => pht(
              'Publish commits currently reachable from any permanent ref, '.
              'ignoring the cached ref state.'),
          ),
          array(
            'name'        => 'repos',
            'wildcard'    => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $repos = $this->loadLocalRepositories($args, 'repos');

    if (!$repos) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify one or more repositories to update refs for.'));
    }

    $console = PhutilConsole::getConsole();
    foreach ($repos as $repo) {
      $console->writeOut(
        "%s
",
        pht(
          'Updating refs in "%s"...',
          $repo->getDisplayName()));

      $engine = id(new PhabricatorRepositoryRefEngine())
        ->setRepository($repo)
        ->setVerbose($args->getArg('verbose'))
        ->setRebuild($args->getArg('rebuild'))
        ->updateRefs();
    }

    $console->writeOut("%s
", pht('Done.'));

    return 0;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorRepositoryManagementRefsWorkflow
  extends PhabricatorRepositoryManagementWorkflow {

  protected function didConstruct() {
    $this
      ->setName('refs')
      ->setExamples('**refs** [__options__] __repository__ ...')
      ->setSynopsis(pht('Update refs in __repository__.'))
      ->setArguments(
        array(
          array(
            'name'        => 'verbose',
            'help'        => pht('Show additional debugging information.'),
          ),
          array(
            'name' => 'rebuild',
            'help' => pht(
              'Publish commits currently reachable from any permanent ref, '.
              'ignoring the cached ref state.'),
          ),
          array(
            'name'        => 'repos',
            'wildcard'    => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $repos = $this->loadLocalRepositories($args, 'repos');

    if (!$repos) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify one or more repositories to update refs for.'));
    }

    $console = PhutilConsole::getConsole();
    foreach ($repos as $repo) {
      $console->writeOut(
        "%s\n",
        pht(
          'Updating refs in "%s"...',
          $repo->getDisplayName()));

      $engine = id(new PhabricatorRepositoryRefEngine())
        ->setRepository($repo)
        ->setVerbose($args->getArg('verbose'))
        ->setRebuild($args->getArg('rebuild'))
        ->updateRefs();
    }

    $console->writeOut("%s\n", pht('Done.'));

    return 0;
  }

}

Function Calls

None

Variables

None

Stats

MD5 f1606012678a07295467ceedec83709d
Eval Count 0
Decode Time 87 ms