CRM-19699: PHP7 define DB_DSN_MODE for drush mysqli compat.
authorMathieu Lutfy <mathieu@bidon.ca>
Wed, 30 Nov 2016 20:22:54 +0000 (15:22 -0500)
committerMathieu Lutfy <mathieu@bidon.ca>
Wed, 30 Nov 2016 20:22:54 +0000 (15:22 -0500)
install/civicrm.php

index c23bf6020b4d364aef7ed6c7f6145dc5a964829a..1e6c0b2cdd497f3f4cfd31d9a7571b9835eddf00 100644 (file)
@@ -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());