[cleanup] Remove deprecated pattern &CRM_Core_Config::singleton()
authoreileen <emcnaughton@wikimedia.org>
Thu, 2 May 2019 02:44:35 +0000 (14:44 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 2 May 2019 02:44:54 +0000 (14:44 +1200)
CRM/Activity/BAO/ICalendar.php
CRM/Utils/System.php
CRM/Utils/System/Base.php
tests/phpunit/CRM/Activity/BAO/ActivityTest.php
tools/bin/scripts/cli.php
tools/bin/scripts/memcache.php
tools/scripts/civimail-spooler/civimail-spooler.php
tools/scripts/solr/createSolrJSON.php
tools/scripts/solr/createSolrXML.php
tools/scripts/solr/createSyncJSON.php

index 4ebc2b0b54bdff0598d3f0243cf7d16061468ef8..cb2cb014eff745ed34526d7214b9f82f2dcf577f 100644 (file)
@@ -67,8 +67,7 @@ class CRM_Activity_BAO_ICalendar {
   public function addAttachment(&$attachments, $contacts) {
     // Check preferences setting
     if (Civi::settings()->get('activity_assignee_notification_ics')) {
-      $config = &CRM_Core_Config::singleton();
-      $this->icsfile = tempnam($config->customFileUploadDir, 'ics');
+      $this->icsfile = tempnam(CRM_Core_Config::singleton()->customFileUploadDir, 'ics');
       if ($this->icsfile !== FALSE) {
         rename($this->icsfile, $this->icsfile . '.ics');
         $this->icsfile .= '.ics';
index 6733d57f7e2c0b620d593a9ca51af4d69230de10..e7af2239c01d03c5af0b4b09f7fa966d34e68413 100644 (file)
@@ -215,8 +215,7 @@ class CRM_Utils_System {
     $print = FALSE,
     $maintenance = FALSE
   ) {
-    $config = &CRM_Core_Config::singleton();
-    return $config->userSystem->theme($content, $print, $maintenance);
+    return CRM_Core_Config::singleton()->userSystem->theme($content, $print, $maintenance);
   }
 
   /**
@@ -1613,8 +1612,7 @@ class CRM_Utils_System {
     $addLanguagePart = TRUE,
     $removeLanguagePart = FALSE
   ) {
-    $config = &CRM_Core_Config::singleton();
-    return $config->userSystem->languageNegotiationURL($url, $addLanguagePart, $removeLanguagePart);
+    return CRM_Core_Config::singleton()->userSystem->languageNegotiationURL($url, $addLanguagePart, $removeLanguagePart);
   }
 
   /**
index 0ad46528d4162e2e9266eb73ede5072faf36cd9b..a83754f7cf651899b056af88dabdec84f2a8089e 100644 (file)
@@ -254,10 +254,9 @@ abstract class CRM_Utils_System_Base {
     }
     $out = $content;
 
-    $config = &CRM_Core_Config::singleton();
     if (
       !$print &&
-      $config->userFramework == 'WordPress'
+      CRM_Core_Config::singleton()->userFramework == 'WordPress'
     ) {
       if (!function_exists('is_admin')) {
         throw new \Exception('Function "is_admin()" is missing, even though WordPress is the user framework.');
index 1f49256bb887c08bbec5813a9105500fed453206..3a1dde23b452a0031ff77bcffc7f57dbd340834a 100644 (file)
@@ -1163,8 +1163,7 @@ $text
   public function testSendSMSWithoutPermission() {
     $dummy = NULL;
     $session = CRM_Core_Session::singleton();
-    $config = &CRM_Core_Config::singleton();
-    $config->userPermissionClass->permissions = array('access CiviCRM');
+    CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM');
 
     CRM_Activity_BAO_Activity::sendSMS(
       $dummy,
index 29b8704da0954d24240033a194e7567af9c6cef6..9ac2f36482570a80c47a3bb7110174f669f08a6f 100644 (file)
@@ -88,8 +88,8 @@ class civicrm_CLI {
   function authenticate($user, $pass) {
     session_start();
     require_once 'CRM/Core/Config.php';
-
-    $config = &CRM_Core_Config::singleton();
+    // Does calling this do anything here?
+    CRM_Core_Config::singleton();
 
     // this does not return on failure
     // require_once 'CRM/Utils/System.php';
index c341602256666a4e033c91fc674a29457784118a..918dc7a486f8078679d809730257378349c8cf1d 100644 (file)
@@ -5,8 +5,8 @@ require_once 'CRM/Utils/Cache.php';
 
 define('CIVICRM_USE_MEMCACHE', 1);
 
-$config = &CRM_Core_Config::singleton();
-$cache = &CRM_Utils_Cache::singleton();
+$config = CRM_Core_Config::singleton();
+$cache = CRM_Utils_Cache::singleton();
 
 $cache->set('CRM_Core_Config' .CRM_Core_Config::domainID(), $config);
 CRM_Core_Error::debug('get', $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID()));
index 63bb5a83a5e90ff6aaff6c0eb63b3e62964a37ff..85ad8fd3daebfb39c9fee7ba490fed9aeaf288b9 100644 (file)
@@ -17,7 +17,7 @@ require_once "$config_file";
 require_once "CRM/Core/Config.php";
 ');
 
-$config = &CRM_Core_Config::singleton();
+$config = CRM_Core_Config::singleton();
 
 /* Temporary permissioning hack for now */
 
index bbe6eeae6c10f50448e0090920188501d595cecd..005c6555c7d49ead4caca5a8db51e4a73ec4acdd 100644 (file)
@@ -373,7 +373,7 @@ function run(&$contactIDs) {
   }
 }
 
-$config = &CRM_Core_Config::singleton();
+$config = CRM_Core_Config::singleton();
 $config->userFramework = 'Soap';
 $config->userFrameworkClass = 'CRM_Utils_System_Soap';
 $config->userHookClass = 'CRM_Utils_Hook_Soap';
index a00b15a4bfa0edd169b819067a45f49734f6287a..f11a20a653646d5933b8da551800283b94f29ca4 100644 (file)
@@ -244,7 +244,7 @@ function run(&$contactIDs) {
   }
 }
 
-$config = &CRM_Core_Config::singleton();
+$config = CRM_Core_Config::singleton();
 $config->userFramework = 'Soap';
 $config->userFrameworkClass = 'CRM_Utils_System_Soap';
 $config->userHookClass = 'CRM_Utils_Hook_Soap';
index 540978056c07fd635fc5cb4eafa1b67c4f1e317c..f4b3bf62e62e13f41a1e3ad7f67157ab40369c84 100644 (file)
@@ -526,7 +526,7 @@ function run(&$values, &$contactIDs, &$allContactIDs) {
   }
 }
 
-$config = &CRM_Core_Config::singleton();
+$config = CRM_Core_Config::singleton();
 $config->userFramework = 'Soap';
 $config->userFrameworkClass = 'CRM_Utils_System_Soap';
 $config->userHookClass = 'CRM_Utils_Hook_Soap';