Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PhpBackend.php

function 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.

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 254

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal