diff --git a/CRM/Utils/System/Backdrop.php b/CRM/Utils/System/Backdrop.php index 508a71d1514b..9dd54af018bc 100644 --- a/CRM/Utils/System/Backdrop.php +++ b/CRM/Utils/System/Backdrop.php @@ -289,9 +289,9 @@ protected function getUsersTableName() { public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { $config = CRM_Core_Config::singleton(); - $ufDSN = CRM_Utils_SQL::autoSwitchDSN($config->userFrameworkDSN); + $ufDSN = $config->userFrameworkDSN; try { - $dbBackdrop = DB::connect($ufDSN); + $dbBackdrop = CRM_Utils_SQL::connect($ufDSN); } catch (Exception $e) { throw new CRM_Core_Exception("Cannot connect to Backdrop database via $ufDSN, " . $e->getMessage()); diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index c2ee73e3058e..4cdc1fae9d80 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -313,9 +313,10 @@ public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realP $config = CRM_Core_Config::singleton(); - $ufDSN = CRM_Utils_SQL::autoSwitchDSN($config->userFrameworkDSN); + $ufDSN = $config->userFrameworkDSN; + try { - $dbDrupal = DB::connect($ufDSN); + $dbDrupal = CRM_Utils_SQL::connect($ufDSN); } catch (Exception $e) { throw new CRM_Core_Exception("Cannot connect to drupal db via $ufDSN, " . $e->getMessage()); diff --git a/ext/standaloneusers/Civi/Standalone/SessionHandler.php b/ext/standaloneusers/Civi/Standalone/SessionHandler.php index 312f0dded4ea..71ac9fb03bc0 100644 --- a/ext/standaloneusers/Civi/Standalone/SessionHandler.php +++ b/ext/standaloneusers/Civi/Standalone/SessionHandler.php @@ -96,7 +96,7 @@ public function gc($max_lifetime): int { * @return bool */ public function open($path, $name): bool { - $this->db = DB::connect(\CRM_Core_Config::singleton()->dsn); + $this->db = \CRM_Utils_SQL::connect(\CRM_Core_Config::singleton()->dsn); $this->db->autoCommit(FALSE); return TRUE; diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index baf92a300f09..1a8d370c5e71 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -596,8 +596,7 @@ public static function toBeSkipped_getSqlOperators() { // Re:^^^ => the failure was probably correct behavior, and test is now fixed, but yeah 5.5 is deprecated, and don't care enough to verify. // Test data providers should be able to run in pre-boot environment, so we connect directly to SQL server. require_once 'DB.php'; - $dsn = CRM_Utils_SQL::autoSwitchDSN(CIVICRM_DSN); - $db = DB::connect($dsn); + $db = CRM_Utils_SQL::connect(CIVICRM_DSN); if ($db->connection instanceof mysqli && $db->connection->server_version < 50600) { $entitiesWithout[] = 'Dedupe'; }