public static function DbServerHandlerFactory::getDbServerHandler in DB Maintenance 7.2
Same name and namespace in other branches
- 8 src/Module/Db/DbServer/DbServerHandlerFactory.php \Drupal\db_maintenance\Module\Db\DbServer\DbServerHandlerFactory::getDbServerHandler()
- 2.0.x src/Module/Db/DbServer/DbServerHandlerFactory.php \Drupal\db_maintenance\Module\Db\DbServer\DbServerHandlerFactory::getDbServerHandler()
Returns proper DbServerHandler.
2 calls to DbServerHandlerFactory::getDbServerHandler()
- DbHandler::listTables in src/
Module/ Db/ DbHandler.php - Get a list of all the tables in a database.
- DbHandler::optimizeTables in src/
Module/ Db/ DbHandler.php - Performs the maintenance.
File
- src/
Module/ Db/ DbServer/ DbServerHandlerFactory.php, line 21 - DbServerHandlerFactory class.
Class
- DbServerHandlerFactory
- DbServerHandlerFactory class.
Namespace
Drupal\db_maintenance\Module\Db\DbServerCode
public static function getDbServerHandler() {
if (db_driver() == 'mysql') {
$handler = new MySqlHandler();
}
elseif (db_driver() == 'pgsql') {
$handler = new PgSqlHandler();
}
else {
throw new \Exception(t('Unsupported DB server type.'));
}
return self::cast($handler);
}