Differential D16848 Diff 40576 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
| Show All 9 Lines | $this | ||||
| ->setSynopsis(pht('Show approximate table sizes.')); | ->setSynopsis(pht('Show approximate table sizes.')); | ||||
| } | } | ||||
| protected function isReadOnlyWorkflow() { | protected function isReadOnlyWorkflow() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function didExecute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $api = $this->getSingleAPI(); | |||||
| $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(); | |||||
| $patches = $this->getPatches(); | $patches = $this->getPatches(); | ||||
| $databases = $api->getDatabaseList($patches, 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( | ||||
| ▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines | |||||