Differential D14463 Diff 35378 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
| <?php | <?php | ||||
| final class PhabricatorStorageManagementProbeWorkflow | final class PhabricatorStorageManagementProbeWorkflow | ||||
| extends PhabricatorStorageManagementWorkflow { | extends PhabricatorStorageManagementWorkflow { | ||||
| protected function didConstruct() { | protected function didConstruct() { | ||||
| $this | $this | ||||
| ->setName('probe') | ->setName('probe') | ||||
| ->setExamples('**probe**') | ->setExamples('**probe**') | ||||
| ->setSynopsis(pht('Show approximate table sizes.')); | ->setSynopsis(pht('Show approximate table sizes.')); | ||||
| } | } | ||||
| public function execute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| $console->writeErr( | $console->writeErr( | ||||
| "%s\n", | "%s\n", | ||||
| pht('Analyzing table sizes (this may take a moment)...')); | pht('Analyzing table sizes (this may take a moment)...')); | ||||
| $api = $this->getAPI(); | $api = $this->getAPI(); | ||||
| $patches = $this->getPatches(); | $patches = $this->getPatches(); | ||||
| $databases = $api->getDatabaseList($patches, $only_living = true); | $databases = $api->getDatabaseList($patches, true); | ||||
| $conn_r = $api->getConn(null); | $conn_r = $api->getConn(null); | ||||
| $data = array(); | $data = array(); | ||||
| foreach ($databases as $database) { | foreach ($databases as $database) { | ||||
| queryfx($conn_r, 'USE %C', $database); | queryfx($conn_r, 'USE %C', $database); | ||||
| $tables = queryfx_all( | $tables = queryfx_all( | ||||
| $conn_r, | $conn_r, | ||||
| ▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines | |||||