You are here

protected function PhpBackend::writeItem in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

\stdClass $item: The cache item to store.

2 calls to PhpBackend::writeItem()
PhpBackend::invalidatebyHash in core/lib/Drupal/Core/Cache/PhpBackend.php
Invalidate one cache item.
PhpBackend::set in core/lib/Drupal/Core/Cache/PhpBackend.php
Stores data in the persistent cache.

File

core/lib/Drupal/Core/Cache/PhpBackend.php, line 246
Contains \Drupal\Core\Cache\PhpBackend.

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);
}