Replace DrupalApcCache::binKey() and DrupalApcCache::key() with DrupalApcCache::keyName()

Created on 22 July 2024, about 2 months ago
Updated 5 August 2024, about 1 month ago

DrupalApcCache::binKey() and DrupalApcCache::key() can be replaced with a single method. In fact, the latter is essentially a wrapper for the first. The new method should also be protected, not private.

  /**
   * Gets the key to use in APC calls.
   *
   * @param string $cid
   *   The cache ID.
   *
   * @return string
   *   The key which can be used in APC calls to avoid conflicts with other
   *   keys.
   */
  protected function keyName($cid = NULL) {
    $key_name = $this->prefix . $this->bin;

    if (!is_null($cid)) {
      $key_name .= "::$cid";
    }

    return $key_name;
  }
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024