You are here

public function DefaultController::optimizeTables in DB Maintenance 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/DefaultController.php \Drupal\db_maintenance\Controller\DefaultController::optimizeTables()
1 string reference to 'DefaultController::optimizeTables'
db_maintenance.routing.yml in ./db_maintenance.routing.yml
db_maintenance.routing.yml

File

src/Controller/DefaultController.php, line 17
Contains \Drupal\db_maintenance\Controller\DefaultController.

Class

DefaultController
Default controller for the db_maintenance module.

Namespace

Drupal\db_maintenance\Controller

Code

public function optimizeTables() {
  DbHandler::optimizeTables();
  $messenger = \Drupal::messenger();
  $messenger
    ->addStatus(new FormattableMarkup('@message', [
    '@message' => t('Database tables optimized'),
  ]));

  //drupal_goto('admin/config/system/db_maintenance');
  return $this
    ->redirect('db_maintenance.admin_settings');
}