You are here

protected function PhpBackend::writeItem in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/PhpBackend.php \Drupal\Core\Cache\PhpBackend::writeItem()
  2. 9 core/lib/Drupal/Core/Cache/PhpBackend.php \Drupal\Core\Cache\PhpBackend::writeItem()

Writes a cache item to PhpStorage.

Parameters

string $cidhash: The hashed version of the original cache ID after being normalized.

object $item: The cache item to store.

File

core/lib/Drupal/Core/Cache/PhpBackend.php, line 243

Class

PhpBackend
Defines a PHP cache implementation.

Namespace

Drupal\Core\Cache

Code

protected function writeItem($cidhash, \stdClass $item) {
  $content = '<?php return unserialize(' . var_export(serialize($item), TRUE) . ');';
  $this
    ->storage()
    ->save($cidhash, $content);
}