Differential D16848 Diff 40576 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php
| Show All 17 Lines | $this | ||||
| 'PhabricatorTestCase'), | 'PhabricatorTestCase'), | ||||
| ), | ), | ||||
| )); | )); | ||||
| } | } | ||||
| public function didExecute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| $api = $this->getSingleAPI(); | |||||
| if (!$this->isDryRun() && !$this->isForce()) { | if (!$this->isDryRun() && !$this->isForce()) { | ||||
| $console->writeOut( | $console->writeOut( | ||||
| phutil_console_wrap( | phutil_console_wrap( | ||||
| pht( | pht( | ||||
| 'Are you completely sure you really want to permanently destroy '. | 'Are you completely sure you really want to permanently destroy '. | ||||
| 'all storage for Phabricator data? This operation can not be '. | 'all storage for Phabricator data? This operation can not be '. | ||||
| 'undone and your data will not be recoverable if you proceed.'))); | 'undone and your data will not be recoverable if you proceed.'))); | ||||
| if (!phutil_console_confirm(pht('Permanently destroy all data?'))) { | if (!phutil_console_confirm(pht('Permanently destroy all data?'))) { | ||||
| $console->writeOut("%s\n", pht('Cancelled.')); | $console->writeOut("%s\n", pht('Cancelled.')); | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| if (!phutil_console_confirm(pht('Really destroy all data forever?'))) { | if (!phutil_console_confirm(pht('Really destroy all data forever?'))) { | ||||
| $console->writeOut("%s\n", pht('Cancelled.')); | $console->writeOut("%s\n", pht('Cancelled.')); | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| } | } | ||||
| $api = $this->getAPI(); | |||||
| $patches = $this->getPatches(); | $patches = $this->getPatches(); | ||||
| if ($args->getArg('unittest-fixtures')) { | if ($args->getArg('unittest-fixtures')) { | ||||
| $conn = $api->getConn(null); | $conn = $api->getConn(null); | ||||
| $databases = queryfx_all( | $databases = queryfx_all( | ||||
| $conn, | $conn, | ||||
| 'SELECT DISTINCT(TABLE_SCHEMA) AS db '. | 'SELECT DISTINCT(TABLE_SCHEMA) AS db '. | ||||
| 'FROM INFORMATION_SCHEMA.TABLES '. | 'FROM INFORMATION_SCHEMA.TABLES '. | ||||
| Show All 36 Lines | |||||