diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php index 9670e01..f6de468 100644 --- a/core/lib/Drupal/Core/Cache/ApcuBackend.php +++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php @@ -62,8 +62,8 @@ class ApcuBackend implements CacheBackendInterface { public function __construct($bin, $site_prefix) { $this->bin = $bin; $this->sitePrefix = $site_prefix; - $this->binPrefix = $this->sitePrefix . $this->bin . '::'; - $this->tagsPrefix = $this->sitePrefix . 'tags::'; + $this->binPrefix = $this->sitePrefix . '::' . $this->bin . '::'; + $this->tagsPrefix = $this->sitePrefix . '::tags::'; } /** diff --git a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php index a18fc6f..6c6d4ba 100644 --- a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php @@ -10,6 +10,20 @@ class ApcuBackendFactory implements CacheFactoryInterface { /** + * The site prefix string. + * + * @var string + */ + protected $sitePrefix; + + /** + * Constructs an ApcuBackendFactory object. + */ + public function __construct() { + $this->sitePrefix = md5(DRUPAL_ROOT . '/' . conf_path()); + } + + /** * Gets ApcuBackend for the specified cache bin. * * @param $bin @@ -18,8 +32,8 @@ class ApcuBackendFactory implements CacheFactoryInterface { * @return \Drupal\Core\Cache\ApcuBackend * The cache backend object for the specified cache bin. */ - function get($bin) { - return new ApcuBackend($bin, conf_path()); + public function get($bin) { + return new ApcuBackend($bin, $this->sitePrefix); } }