deprecate direct calls to isDevelopment
authordemeritcowboy <demeritcowboy@hotmail.com>
Mon, 11 Jan 2021 16:35:03 +0000 (11:35 -0500)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Mon, 11 Jan 2021 20:02:56 +0000 (15:02 -0500)
CRM/Utils/System.php
api/v3/System.php

index 98685df52ba3c5e085408b017d43667967bd8e65..5c27f998d451fb88c75aaf7b1cb3e8b67a14932f 100644 (file)
@@ -1829,6 +1829,7 @@ class CRM_Utils_System {
   }
 
   /**
+   * @deprecated
    * Determine whether this system is deployed using version control.
    *
    * Normally sites would tune their php error settings to prevent deprecation
@@ -1844,6 +1845,7 @@ class CRM_Utils_System {
    * @return bool
    */
   public static function isDevelopment() {
+    CRM_Core_Error::deprecatedWarning('isDevelopment() is deprecated. Set your php error_reporting or MySQL settings appropriately instead.');
     static $cache = NULL;
     if ($cache === NULL) {
       global $civicrm_root;
index c207ac9e13e58de51d5c29d9c3ca4a451c530b2e..0e0b3c679b361ec13a6f7c0fca593241e7cd9e79 100644 (file)
@@ -238,7 +238,7 @@ function civicrm_api3_system_get($params) {
       ],
       'civi' => [
         'version' => CRM_Utils_System::version(),
-        'dev' => (bool) CRM_Utils_System::isDevelopment(),
+        'dev' => (\Civi::settings()->get('environment') === 'Development'),
         'components' => array_keys(CRM_Core_Component::getEnabledComponents()),
         'extensions' => preg_grep('/^uninstalled$/', CRM_Extension_System::singleton()->getManager()->getStatuses(), PREG_GREP_INVERT),
         'multidomain' => CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM civicrm_domain') > 1,