Revert changes in CRM/Core/BAO{Cache|ConfigSetting}.php CRM/Extension/ClassLoader...
[civicrm-core.git] / CRM / Utils / Cache / Memcached.php
index 546c5b933b9a0b006c478ed15f8895dfa0b41219..fd3aee39c236fe795e16141fab26cc9d5b05361c 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Utils_Cache_Memcached implements CRM_Utils_Cache_Interface {
 
-  use CRM_Utils_Cache_NaiveMultipleTrait; // TODO Consider native implementation.
+  // TODO Consider native implementation.
+  use CRM_Utils_Cache_NaiveMultipleTrait;
 
   const DEFAULT_HOST = 'localhost';
   const DEFAULT_PORT = 11211;
@@ -227,7 +228,8 @@ class CRM_Utils_Cache_Memcached implements CRM_Utils_Cache_Interface {
     $maxLen = self::MAX_KEY_LEN - strlen($truePrefix);
     $key = preg_replace('/\s+|\W+/', '_', $key);
     if (strlen($key) > $maxLen) {
-      $md5Key = md5($key);  // this should be 32 characters in length
+      // this should be 32 characters in length
+      $md5Key = md5($key);
       $subKeyLen = $maxLen - 1 - strlen($md5Key);
       $key = substr($key, 0, $subKeyLen) . "_" . $md5Key;
     }
@@ -256,7 +258,8 @@ class CRM_Utils_Cache_Memcached implements CRM_Utils_Cache_Interface {
       $value = $this->_cache->get($key);
       if ($this->_cache->getResultCode() === Memcached::RES_NOTFOUND) {
         $value = uniqid();
-        $this->_cache->add($key, $value, 0); // Indefinite.
+        // Indefinite.
+        $this->_cache->add($key, $value, 0);
       }
       $this->_truePrefix = [
         'value' => $value,