Differential D14463 Diff 35378 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
| <?php | <?php | ||||
| final class PhabricatorStorageManagementDumpWorkflow | final class PhabricatorStorageManagementDumpWorkflow | ||||
| extends PhabricatorStorageManagementWorkflow { | extends PhabricatorStorageManagementWorkflow { | ||||
| protected function didConstruct() { | protected function didConstruct() { | ||||
| $this | $this | ||||
| ->setName('dump') | ->setName('dump') | ||||
| ->setExamples('**dump** [__options__]') | ->setExamples('**dump** [__options__]') | ||||
| ->setSynopsis(pht('Dump all data in storage to stdout.')); | ->setSynopsis(pht('Dump all data in storage to stdout.')); | ||||
| } | } | ||||
| public function execute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $console = PhutilConsole::getConsole(); | |||||
| $api = $this->getAPI(); | $api = $this->getAPI(); | ||||
| $patches = $this->getPatches(); | $patches = $this->getPatches(); | ||||
| $console = PhutilConsole::getConsole(); | |||||
| $applied = $api->getAppliedPatches(); | $applied = $api->getAppliedPatches(); | ||||
| if ($applied === null) { | if ($applied === null) { | ||||
| $namespace = $api->getNamespace(); | $namespace = $api->getNamespace(); | ||||
| $console->writeErr( | $console->writeErr( | ||||
| pht( | pht( | ||||
| '**Storage Not Initialized**: There is no database storage '. | '**Storage Not Initialized**: There is no database storage '. | ||||
| 'initialized in this storage namespace ("%s"). Use '. | 'initialized in this storage namespace ("%s"). Use '. | ||||
| '**%s** to initialize storage.', | '**%s** to initialize storage.', | ||||
| $namespace, | $namespace, | ||||
| 'storage upgrade')); | './bin/storage upgrade')); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| $databases = $api->getDatabaseList($patches, $only_living = true); | $databases = $api->getDatabaseList($patches, true); | ||||
| list($host, $port) = $this->getBareHostAndPort($api->getHost()); | list($host, $port) = $this->getBareHostAndPort($api->getHost()); | ||||
| $flag_password = ''; | $flag_password = ''; | ||||
| $password = $api->getPassword(); | $password = $api->getPassword(); | ||||
| if ($password) { | if ($password) { | ||||
| if (strlen($password->openEnvelope())) { | if (strlen($password->openEnvelope())) { | ||||
| $flag_password = csprintf('-p%P', $password); | $flag_password = csprintf('-p%P', $password); | ||||
| Show All 18 Lines | |||||