X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache.php;h=94b2cfb4ee28698a515b59b17abfa127eded7d4b;hb=24a8c2f7bc0d6ce8472a8a8aaca8551f634b36c9;hp=1a338ec4457a00be00602701f925ef3bcd8617f5;hpb=e9aca61e8b08d5ae372621c4397108b8f2ec28ba;p=civicrm-core.git diff --git a/CRM/Utils/Cache.php b/CRM/Utils/Cache.php index 1a338ec445..94b2cfb4ee 100644 --- a/CRM/Utils/Cache.php +++ b/CRM/Utils/Cache.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -23,12 +23,12 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ @@ -43,14 +43,14 @@ class CRM_Utils_Cache { * pattern and cache the instance in this variable * * @var object - * @static */ static private $_singleton = NULL; /** - * Constructor + * Constructor. * - * @param array $config an array of configuration params + * @param array $config + * An array of configuration params. * * @return \CRM_Utils_Cache */ @@ -59,11 +59,9 @@ class CRM_Utils_Cache { } /** - * Singleton function used to manage this object + * Singleton function used to manage this object. * * @return object - * @static - * */ public static function &singleton() { if (self::$_singleton === NULL) { @@ -76,16 +74,16 @@ class CRM_Utils_Cache { if (defined('CIVICRM_USE_MEMCACHE') && CIVICRM_USE_MEMCACHE) { $className = 'Memcache'; } - else if (defined('CIVICRM_USE_ARRAYCACHE') && CIVICRM_USE_ARRAYCACHE) { + elseif (defined('CIVICRM_USE_ARRAYCACHE') && CIVICRM_USE_ARRAYCACHE) { $className = 'ArrayCache'; } - else if (defined('CIVICRM_DB_CACHE_CLASS') && CIVICRM_DB_CACHE_CLASS) { + elseif (defined('CIVICRM_DB_CACHE_CLASS') && CIVICRM_DB_CACHE_CLASS) { $className = CIVICRM_DB_CACHE_CLASS; } // a generic method for utilizing any of the available db caches. $dbCacheClass = 'CRM_Utils_Cache_' . $className; - require_once(str_replace('_', DIRECTORY_SEPARATOR, $dbCacheClass) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $dbCacheClass) . '.php'; $settings = self::getCacheSettings($className); self::$_singleton = new $dbCacheClass($settings); } @@ -93,13 +91,12 @@ class CRM_Utils_Cache { } /** - * Get cache relevant settings + * Get cache relevant settings. * * @param $cachePlugin * * @return array * associative array of settings for the cache - * @static */ public static function getCacheSettings($cachePlugin) { switch ($cachePlugin) { @@ -165,4 +162,5 @@ class CRM_Utils_Cache { } return $defaults; } + }