CRM-17789 - Display advisory about mysqli
authorTim Otten <totten@civicrm.org>
Mon, 25 Jul 2016 21:52:46 +0000 (14:52 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 25 Jul 2016 21:52:46 +0000 (14:52 -0700)
CRM/Utils/Check/Component/Env.php

index 48f88870f06e3e097c76edd0281725c38ba4fdee..38548da9b26035cec0365b8970c6e6e2b671f217 100644 (file)
@@ -68,6 +68,29 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
     return $messages;
   }
 
+  /**
+   * @return array
+   */
+  public function checkPhpMysqli() {
+    $messages = array();
+
+    if (!extension_loaded('mysqli')) {
+      $messages[] = new CRM_Utils_Check_Message(
+        __FUNCTION__,
+        ts('Future versions of CiviCRM may require the PHP extension "%2". To ensure that your system will be compatible, please install it in advance. For more explanation, see <a href="%1">the announcement</a>.',
+          array(
+            1 => 'https://civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli',
+            2 => 'mysqli',
+          )),
+        ts('Forward Compatibility: Enable "mysqli"'),
+        \Psr\Log\LogLevel::WARNING,
+        'fa-server'
+      );
+    }
+
+    return $messages;
+  }
+
   /**
    * Check that the MySQL time settings match the PHP time settings.
    *