You are here

protected function CleanerMysqlOptimizeEventSubscriber::buildTablesList in Cleaner 8.2

Build the tables list.

Return value

array Tables list array. Tables list array.

1 call to CleanerMysqlOptimizeEventSubscriber::buildTablesList()
CleanerMysqlOptimizeEventSubscriber::optimizeMysql in src/EventSubscriber/CleanerMysqlOptimizeEventSubscriber.php
Cleaner MySQL optimization.

File

src/EventSubscriber/CleanerMysqlOptimizeEventSubscriber.php, line 175

Class

CleanerMysqlOptimizeEventSubscriber
Class CleanerMysqlOptimizeEventSubscriber.

Namespace

Drupal\cleaner\EventSubscriber

Code

protected function buildTablesList() {
  $list = [];
  $tables = (array) $this->database
    ->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;
}