From 4caaa69694482b8a33648f5f9312039e438dcaf2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 23 Jun 2014 11:43:45 +1200 Subject: [PATCH] CRM-14850 add code comments to clarify that checking the CMS is not the recommended approach --- CRM/Utils/System/Base.php | 20 ++++++++++++++++++++ CRM/Utils/System/DrupalBase.php | 6 ++++++ CRM/Utils/System/Joomla.php | 6 ++++++ CRM/Utils/System/WordPress.php | 6 ++++++ 4 files changed, 38 insertions(+) diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index c64d11173b..a92882a41d 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -4,8 +4,28 @@ * Base class for UF system integrations */ abstract class CRM_Utils_System_Base { + /** + * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ var $is_drupal = FALSE; + + /** + * deprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ var $is_joomla = FALSE; + + /** + * deprecated property to check if this is a wordpress install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ var $is_wordpress = FALSE; /** diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index cc05a46f42..7452ab8c7b 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -48,6 +48,12 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * */ function __construct() { + /** + * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ $this->is_drupal = TRUE; $this->supports_form_extensions = TRUE; } diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 3c56456e1e..3951f52b8d 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -41,6 +41,12 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * */ function __construct() { + /** + * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ $this->is_drupal = FALSE; } diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 78ad9f0d92..a3aecc0184 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -41,6 +41,12 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * */ function __construct() { + /** + * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific + * functions and leave the codebase oblivious to the type of CMS + * @deprecated + * @var bool + */ $this->is_drupal = FALSE; } -- 2.25.1