%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/losik.varak.net/vendor/nette/caching/src/Caching/Storages/
Upload File :
Create Path :
Current File : /www/varak.net/losik.varak.net/vendor/nette/caching/src/Caching/Storages/MemoryStorage.php

<?php

/**
 * This file is part of the Nette Framework (https://nette.org)
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 */

declare(strict_types=1);

namespace Nette\Caching\Storages;

use Nette;


/**
 * Memory cache storage.
 */
class MemoryStorage implements Nette\Caching\Storage
{
	use Nette\SmartObject;

	/** @var array */
	private $data = [];


	public function read(string $key)
	{
		return $this->data[$key] ?? null;
	}


	public function lock(string $key): void
	{
	}


	public function write(string $key, $data, array $dependencies): void
	{
		$this->data[$key] = $data;
	}


	public function remove(string $key): void
	{
		unset($this->data[$key]);
	}


	public function clean(array $conditions): void
	{
		if (!empty($conditions[Nette\Caching\Cache::All])) {
			$this->data = [];
		}
	}
}

Zerion Mini Shell 1.0