Unverified Commit 934f42ae authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3129043 by mondrake, daffie, ankithashetty, ravi.shankar, alexpott,...

Issue #3129043 by mondrake, daffie, ankithashetty, ravi.shankar, alexpott, Beakerboy, catch: Move core database drivers to modules of their own
parent 5c92c241
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@
            "dist": {
                "type": "path",
                "url": "core",
                "reference": "3009c9eaa73ac4f9ff0d92a18714a2f9ac7a8877"
                "reference": "fe303578f231198d09504af69ee768be7c455b06"
            },
            "require": {
                "asm89/stack-cors": "^1.1",
@@ -583,12 +583,14 @@
                "drupal/migrate_drupal_multilingual": "self.version",
                "drupal/migrate_drupal_ui": "self.version",
                "drupal/minimal": "self.version",
                "drupal/mysql": "self.version",
                "drupal/node": "self.version",
                "drupal/olivero": "self.version",
                "drupal/options": "self.version",
                "drupal/page_cache": "self.version",
                "drupal/path": "self.version",
                "drupal/path_alias": "self.version",
                "drupal/pgsql": "self.version",
                "drupal/quickedit": "self.version",
                "drupal/rdf": "self.version",
                "drupal/responsive_image": "self.version",
@@ -598,6 +600,7 @@
                "drupal/settings_tray": "self.version",
                "drupal/seven": "self.version",
                "drupal/shortcut": "self.version",
                "drupal/sqlite": "self.version",
                "drupal/standard": "self.version",
                "drupal/stark": "self.version",
                "drupal/statistics": "self.version",
@@ -668,9 +671,6 @@
                    "lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php",
                    "lib/Drupal/Core/Database/Connection.php",
                    "lib/Drupal/Core/Database/Database.php",
                    "lib/Drupal/Core/Database/Driver/mysql/Connection.php",
                    "lib/Drupal/Core/Database/Driver/pgsql/Connection.php",
                    "lib/Drupal/Core/Database/Driver/sqlite/Connection.php",
                    "lib/Drupal/Core/Database/Statement.php",
                    "lib/Drupal/Core/Database/StatementInterface.php",
                    "lib/Drupal/Core/DependencyInjection/Container.php",
+3 −3
Original line number Diff line number Diff line
@@ -170,9 +170,9 @@
 * information on these defaults and the potential issues.
 *
 * More details can be found in the constructor methods for each driver:
 * - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
 * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
 * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
 * - \Drupal\mysql\Driver\Database\mysql\Connection::__construct()
 * - \Drupal\pgsql\Driver\Database\pgsql\Connection::__construct()
 * - \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
 *
 * Sample Database configuration format for PostgreSQL (pgsql):
 * @code
+3 −3
Original line number Diff line number Diff line
@@ -132,12 +132,14 @@
        "drupal/migrate_drupal": "self.version",
        "drupal/migrate_drupal_multilingual": "self.version",
        "drupal/migrate_drupal_ui": "self.version",
        "drupal/mysql": "self.version",
        "drupal/node": "self.version",
        "drupal/olivero": "self.version",
        "drupal/options": "self.version",
        "drupal/page_cache": "self.version",
        "drupal/path": "self.version",
        "drupal/path_alias": "self.version",
        "drupal/pgsql": "self.version",
        "drupal/quickedit": "self.version",
        "drupal/rdf": "self.version",
        "drupal/responsive_image": "self.version",
@@ -147,6 +149,7 @@
        "drupal/settings_tray": "self.version",
        "drupal/seven": "self.version",
        "drupal/shortcut": "self.version",
        "drupal/sqlite": "self.version",
        "drupal/standard": "self.version",
        "drupal/stark": "self.version",
        "drupal/statistics": "self.version",
@@ -189,9 +192,6 @@
            "lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php",
            "lib/Drupal/Core/Database/Connection.php",
            "lib/Drupal/Core/Database/Database.php",
            "lib/Drupal/Core/Database/Driver/mysql/Connection.php",
            "lib/Drupal/Core/Database/Driver/pgsql/Connection.php",
            "lib/Drupal/Core/Database/Driver/sqlite/Connection.php",
            "lib/Drupal/Core/Database/Statement.php",
            "lib/Drupal/Core/Database/StatementInterface.php",
            "lib/Drupal/Core/DependencyInjection/Container.php",
+4 −3
Original line number Diff line number Diff line
@@ -171,12 +171,13 @@ function drupal_get_database_types() {
  // The internal database driver name is any valid PHP identifier.
  $mask = ExtensionDiscovery::PHP_FUNCTION_PATTERN;

  // Find drivers in the Drupal\Core and Drupal\Driver namespaces.
  // Find drivers in the Drupal\Driver namespace.
  // @todo remove discovering in the Drupal\Driver namespace in D10.
  /** @var \Drupal\Core\File\FileSystemInterface $file_system */
  $file_system = \Drupal::service('file_system');
  $files = $file_system->scanDirectory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', $mask, ['recurse' => FALSE]);
  $files = [];
  if (is_dir(DRUPAL_ROOT . '/drivers/lib/Drupal/Driver/Database')) {
    $files += $file_system->scanDirectory(DRUPAL_ROOT . '/drivers/lib/Drupal/Driver/Database/', $mask, ['recurse' => FALSE]);
    $files = $file_system->scanDirectory(DRUPAL_ROOT . '/drivers/lib/Drupal/Driver/Database/', $mask, ['recurse' => FALSE]);
  }
  foreach ($files as $file) {
    if (file_exists($file->uri . '/Install/Tasks.php')) {
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ protected function getTableIndexes(Connection $connection, $table, &$definition)
   */
  protected function getTableCollation(Connection $connection, $table, &$definition) {
    // Remove identifier quotes from the table name. See
    // \Drupal\Core\Database\Driver\mysql\Connection::$identifierQuotes.
    // \Drupal\mysql\Driver\Database\mysql\Connection::$identifierQuotes.
    $table = trim($connection->prefixTables('{' . $table . '}'), '"');
    $query = $connection->query("SHOW TABLE STATUS WHERE NAME = :table_name", [':table_name' => $table]);
    $data = $query->fetchAssoc();
Loading