Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • DevNullStorage
  • FileStorage
  • MemcachedStorage
  • MemoryStorage
  • NewMemcachedStorage
  • SQLiteJournal
  • SQLiteStorage

Interfaces

  • IJournal
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Caching\Storages;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * Memory cache storage.
15:  */
16: class MemoryStorage implements Nette\Caching\IStorage
17: {
18:     use Nette\SmartObject;
19: 
20:     /** @var array */
21:     private $data = [];
22: 
23: 
24:     public function read($key)
25:     {
26:         return isset($this->data[$key]) ? $this->data[$key] : null;
27:     }
28: 
29: 
30:     public function lock($key)
31:     {
32:     }
33: 
34: 
35:     public function write($key, $data, array $dependencies)
36:     {
37:         $this->data[$key] = $data;
38:     }
39: 
40: 
41:     public function remove($key)
42:     {
43:         unset($this->data[$key]);
44:     }
45: 
46: 
47:     public function clean(array $conditions)
48:     {
49:         if (!empty($conditions[Nette\Caching\Cache::ALL])) {
50:             $this->data = [];
51:         }
52:     }
53: }
54: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0