You are here

public function CacheApcu::Set in Drupal driver for SQL Server and SQL Azure 8.2

Set a cache item.

Parameters

string $cid:

mixed $data:

Overrides CacheInterface::Set

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Component/CacheApcu.php, line 43

Class

CacheApcu
Apcu implementation for the in-memory fast cache. Use this for very frequently used cache items.

Namespace

Drupal\Driver\Database\sqlsrv\Component

Code

public function Set($cid, $data) {
  $cache = new \stdClass();
  $cache->data = $data;
  $cache->serialized = false;
  $cache->timestamp = time();
  $this->data[$cid] = clone $cache;
  apcu_store($this->prefix . ':' . $cid, $cache);
}