W3cubDocs

/Drupal 8

protected function PhpBackend::writeItem

protected PhpBackend::writeItem($cidhash, \stdClass $item)

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.

File

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

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!PhpBackend.php/function/PhpBackend::writeItem/8.1.x