database: Don't treat $defaultSchemas as containing all types/drivers
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 15 Jun 2015 17:15:28 +0000 (18:15 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 15 Jun 2015 17:16:32 +0000 (18:16 +0100)
commitbb61a0486e0657f366a77e34593ea9540d12c8a7
tree0b3b19731f4fd50662575d4d7fa92dde8500b19b
parent982a2a21ce21803824ed008766ed15b760f3020c
database: Don't treat $defaultSchemas as containing all types/drivers

The Database::factory() method treats $dbType as of one of
predefined "canonicalDBTypes", and defaults to using it as driver.
Which is then used for the name of the Database subclass.

This allows extensions and wiki farms to have custom subclasses
to override certain methods, or even provide new drivers.

The $defaultSchemas array added in f7174057a4 was given all canonical
keys (with null values) to allow unconditionally access. This
doesn't scale very well and is error-prone. Reduce it to the
override only and fallback make the fallback to null explicitly.

See T102285 for where this would help prevent a PHP Notice.

Change-Id: I3f1e1f59c300d34de30f6480ff4e54f159d51b16
includes/db/Database.php