The DatabaseFactory loads the database configuration and instantiates and registers the correct type of database adaptor object based on the config. This is used in the bootstrap.
if (AppConfig::get('DatabaseEnabled')) {
AppLoader::includeClass('php/database/', 'DatabaseFactory');
$objDatabaseFactory = new DatabaseFactory('database');
AppRegistry::register('Database', $objDatabaseFactory->init());
}