From 84d94b6499fc85874f68c529af33c53bae1dee46 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 11 Jan 2021 11:35:03 -0500 Subject: [PATCH] deprecate direct calls to isDevelopment --- CRM/Utils/System.php | 2 ++ api/v3/System.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 98685df52b..5c27f998d4 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -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; diff --git a/api/v3/System.php b/api/v3/System.php index c207ac9e13..0e0b3c679b 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -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, -- 2.25.1