rdbms: Simplify Database::factory()
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 24 Jan 2018 19:33:37 +0000 (11:33 -0800)
committerKrinkle <krinklemail@gmail.com>
Thu, 25 Jan 2018 17:35:55 +0000 (17:35 +0000)
commit76e8d9762581f0564b7400503fdf20fb04df6352
treebe19b1a30bc7edb9c588b5062b49f9d2b701dee4
parent3833a9e07c5d20ee2e98e9bab9c0af52ac406358
rdbms: Simplify Database::factory()

Follows-up 0ff2b7a776 (T120333) which removed support for the
deprecated php 'mysql' extension.

It surprised me that the 'DatabaseMysql' entry could safely be removed
from $classAliases. This was because the key is not direct input,
but based on $canonicalDBTypes, which maps mysql to mysqli.

Take this further by removing the indirection between type, driver
and class name.

* Map built-in db types directly to their class and driver.
* Change fallback to assign $class directly from $dbType, without
  indirection of a $driver variable.
* Remove unused $classAliases.

Change-Id: I1200b07f66f23624410d848b6f382cb2dafa5c59
includes/libs/rdbms/database/Database.php