From 3045e3f42150e983fe5f65c34978f4a3a0de9d1a Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 30 Nov 2016 15:22:54 -0500 Subject: [PATCH] CRM-19699: PHP7 define DB_DSN_MODE for drush mysqli compat. --- install/civicrm.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install/civicrm.php b/install/civicrm.php index c23bf6020b..1e6c0b2cdd 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -147,6 +147,13 @@ function civicrm_source($dsn, $fileName, $lineMode = FALSE) { require_once "$crmPath/packages/DB.php"; + // CRM-19699 See also CRM_Core_DAO for PHP7 mysqli compatiblity. + // Duplicated here because this is not using CRM_Core_DAO directly + // and this function may be called directly from Drush. + if (!defined('DB_DSN_MODE')) { + define('DB_DSN_MODE', 'auto'); + } + $db = DB::connect($dsn); if (PEAR::isError($db)) { die("Cannot open $dsn: " . $db->getMessage()); -- 2.25.1