ILIAS  release_8 Revision v8.23
ilStaticCache Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilStaticCache:
+ Collaboration diagram for ilStaticCache:

Public Member Functions

 exists (string $key)
 
 set (string $key, $serialized_value, int $ttl=null)
 
 get (string $key)
 
 delete (string $key)
 
 flush (bool $complete=false)
 
 serialize ($value)
 
 unserialize ($serialized_value)
 
- Public Member Functions inherited from ilGlobalCacheService
 __construct (string $service_id, string $component)
 ilGlobalCacheService constructor. More...
 
 unserialize ($serialized_value)
 
 get (string $key)
 
 set (string $key, $serialized_value, int $ttl=null)
 
 serialize ($value)
 
 getServiceId ()
 
 setServiceId (string $service_id)
 
 getComponent ()
 
 setComponent (string $component)
 
 isActive ()
 
 isInstallable ()
 
 returnKey (string $key)
 
 getInfo ()
 
 getInstallationFailureReason ()
 
 exists (string $key)
 
 delete (string $key)
 
 flush (bool $complete=false)
 
 setServiceType (int $service_type)
 
 getServiceType ()
 
 setValid (string $key)
 Declare a key as valid. More...
 
 isValid (string $key)
 Checks whether the cache key is valid or not. More...
 

Protected Member Functions

 getActive ()
 
 getInstallable ()
 
- Protected Member Functions inherited from ilGlobalCacheService
 getActive ()
 
 getInstallable ()
 
 getMemoryLimit ()
 
 getMinMemory ()
 
 checkMemory ()
 

Static Protected Attributes

static array $cache = []
 
- Static Protected Attributes inherited from ilGlobalCacheService
static array $active = array()
 
static array $installable = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilGlobalCacheService
int $current_time = 0
 
array $valid_keys = array()
 
string $service_id = ''
 
string $component = ''
 
int $service_type = ilGlobalCache::TYPE_STATIC
 
string $valid_key_hash = ''
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilStaticCache

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 25 of file class.ilStaticCache.php.

Member Function Documentation

◆ delete()

ilStaticCache::delete ( string  $key)

Implements ilGlobalCacheServiceInterface.

Definition at line 61 of file class.ilStaticCache.php.

References ilGlobalCacheService\getComponent().

61  : bool
62  {
63  unset(self::$cache[$this->getComponent()][$key]);
64 
65  return true;
66  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ exists()

ilStaticCache::exists ( string  $key)

Implements ilGlobalCacheServiceInterface.

Definition at line 39 of file class.ilStaticCache.php.

References ilGlobalCacheService\getComponent().

39  : bool
40  {
41  return isset(self::$cache[$this->getComponent()][$key]);
42  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ flush()

ilStaticCache::flush ( bool  $complete = false)

Implements ilGlobalCacheServiceInterface.

Definition at line 68 of file class.ilStaticCache.php.

References ilGlobalCacheService\getComponent().

68  : bool
69  {
70  if ($complete) {
71  self::$cache = [];
72  } else {
73  unset(self::$cache[$this->getComponent()]);
74  }
75 
76  return true;
77  }
+ Here is the call graph for this function:

◆ get()

ilStaticCache::get ( string  $key)
Returns
mixed

Implements ilGlobalCacheServiceInterface.

Definition at line 56 of file class.ilStaticCache.php.

References ILIAS\LTI\ToolProvider\$key, and ilGlobalCacheService\getComponent().

57  {
58  return self::$cache[$this->getComponent()][$key] ?? null;
59  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ getActive()

ilStaticCache::getActive ( )
protected

Definition at line 27 of file class.ilStaticCache.php.

27  : bool
28  {
29  return true;
30  }

◆ getInstallable()

ilStaticCache::getInstallable ( )
protected

Definition at line 32 of file class.ilStaticCache.php.

32  : bool
33  {
34  return true;
35  }

◆ serialize()

ilStaticCache::serialize (   $value)
Parameters
mixed$value
Returns
mixed

Definition at line 83 of file class.ilStaticCache.php.

84  {
85  return ($value);
86  }

◆ set()

ilStaticCache::set ( string  $key,
  $serialized_value,
int  $ttl = null 
)
Parameters
mixed$serialized_value

Implements ilGlobalCacheServiceInterface.

Definition at line 47 of file class.ilStaticCache.php.

References ILIAS\LTI\ToolProvider\$key, and ilGlobalCacheService\getComponent().

47  : bool
48  {
49  self::$cache[$this->getComponent()][$key] = $serialized_value;
50  return true;
51  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ unserialize()

ilStaticCache::unserialize (   $serialized_value)
Parameters
mixed$serialized_value
Returns
mixed

Implements ilGlobalCacheServiceInterface.

Definition at line 92 of file class.ilStaticCache.php.

93  {
94  return ($serialized_value);
95  }

Field Documentation

◆ $cache

array ilStaticCache::$cache = []
staticprotected

Definition at line 37 of file class.ilStaticCache.php.


The documentation for this class was generated from the following file: