You are here

function apdqc_admin_convert_table_engine_to_innodb in Asynchronous Prefetch Database Query Cache 7

Convert table engine to InnoDB.

Parameters

bool $show_msg: Set to FALSE to not run drupal_set_message().

1 string reference to 'apdqc_admin_convert_table_engine_to_innodb'
apdqc_admin_operations_form in ./apdqc.admin.inc
Form builder; perform apdqc operations.

File

./apdqc.admin.inc, line 590
Admin page callbacks for the apdqc module.

Code

function apdqc_admin_convert_table_engine_to_innodb($show_msg = TRUE) {

  // Run the command.
  $return = apdqc_admin_change_table_engine(TRUE);

  // Let user know it worked.
  if ($return !== FALSE) {
    if ($show_msg !== FALSE) {
      if (!empty($return)) {
        drupal_set_message(t('APDQC: All cache tables engines converted to InnoDB'));
      }
      else {
        drupal_set_message(t('APDQC: All cache tables engines were already InnoDB'));
      }
    }
  }
  else {
    $tables = apdqc_admin_change_table_engine();
    drupal_set_message(t('APDQC: Cache tables could not be converted to InnoDB. Use a tool like phpmyadmin and convert these cache tables manually to InnoDB - @tables.', array(
      '@tables' => implode(', ', $tables),
    )), 'error');
  }
  variable_set('apdqc_innodb', TRUE);
}