Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

It is now possible to place various drivers in a directory called 'drivers' placed in the Drupal root besides core, modules etc. The PSR-4 autoloader will pick up classes from drivers/lib.

Also, the installation system can find database drivers in drivers/lib/Drupal/Driver/Database/drivername using the Drupal\Driver\Database\drivername namespace. The driver must implement all the following classes:

  • Connection.php
  • Delete.php
  • Insert.php
  • Install/Task.php
  • Merge.php
  • Schema.php
  • Select.php
  • Transaction.php
  • Truncate.php
  • Update.php

It is even possible to put database drivers anywhere -- the $database array in settings.php now include snamespace and it is possible to call drupal_classloader_register from settings.php. This is not a recommended practice, however. Use the designated drivers directory instead.

Comments

ludiam0ndz’s picture

For the Oracle Module on Drupal 8 php 7.2 this approach no longer works to enable the Oracle module.