You are here

function optimizedb_check_works in OptimizeDB 7

Check the module can work with the database driver.

Return value

string|false

4 calls to optimizedb_check_works()
optimizedb_admin in ./optimizedb.module
Configuring the module.
optimizedb_hide_notification in ./optimizedb.module
Page hide notification.
optimizedb_list_tables in ./optimizedb.module
List of tables in the database with the size and sorting.
optimizedb_requirements in ./optimizedb.install
Implements hook_requirements().

File

./optimizedb.module, line 85
Database Optimization.

Code

function optimizedb_check_works() {

  // Ensure translations don't break during installation.
  $t = get_t();
  $list_drivers = optimizedb_available_db_drivers();
  $db_driver = db_driver();
  if (!in_array($db_driver, $list_drivers)) {
    return $t('The module Optimizedb does not work with db driver "@name".', array(
      '@name' => $db_driver,
    ));
  }
  return FALSE;
}