ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilStaticCache.php
Go to the documentation of this file.
1 <?php
2 
26 {
27  protected function getActive(): bool
28  {
29  return true;
30  }
31 
32  protected function getInstallable(): bool
33  {
34  return true;
35  }
36 
37  protected static array $cache = [];
38 
39  public function exists(string $key): bool
40  {
41  return isset(self::$cache[$this->getComponent()][$key]);
42  }
43 
47  public function set(string $key, $serialized_value, int $ttl = null): bool
48  {
49  self::$cache[$this->getComponent()][$key] = $serialized_value;
50  return true;
51  }
52 
56  public function get(string $key)
57  {
58  return self::$cache[$this->getComponent()][$key] ?? null;
59  }
60 
61  public function delete(string $key): bool
62  {
63  unset(self::$cache[$this->getComponent()][$key]);
64 
65  return true;
66  }
67 
68  public function flush(bool $complete = false): bool
69  {
70  if ($complete) {
71  self::$cache = [];
72  } else {
73  unset(self::$cache[$this->getComponent()]);
74  }
75 
76  return true;
77  }
78 
83  public function serialize($value)
84  {
85  return ($value);
86  }
87 
92  public function unserialize($serialized_value)
93  {
94  return ($serialized_value);
95  }
96 }
flush(bool $complete=false)
static array $cache
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exists(string $key)
string $key
Consumer key/client ID value.
Definition: System.php:193
unserialize($serialized_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...