You are here

protected function CleanerMySqlOptimizationController::buildTablesList in Cleaner 8

Build the tables list.

Return value

array Tables list array. Tables list array.

1 call to CleanerMySqlOptimizationController::buildTablesList()
CleanerMySqlOptimizationController::mysqlOptimize in src/Controller/CleanerMySqlOptimizationController.php
MySQL optimizer.

File

src/Controller/CleanerMySqlOptimizationController.php, line 142

Class

CleanerMySqlOptimizationController
Class CleanerMySqlOptimizationController.

Namespace

Drupal\cleaner\Controller

Code

protected function buildTablesList() {
  $list = [];
  $tables = (array) $this->connection
    ->query("SHOW TABLE STATUS");
  if (!empty($tables)) {
    foreach ($tables as $table) {
      if (isset($table->Data_free) && !empty($table->Data_free)) {
        $list[] = (string) $table->Name;
      }
    }
  }
  return $list;
}