ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilStaticCache Class Reference

Class ilStaticCache. More...

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

Public Member Functions

 exists ($key)
 
 set ($key, $serialized_value, $ttl=null)
 
 get ($key)
 
 delete ($key)
 
 flush ($complete=false)
 
 serialize ($value)
 
 unserialize ($serialized_value)
 
- Public Member Functions inherited from ilGlobalCacheService
 __construct ($service_id, $component)
 
 unserialize ($serialized_value)
 
 get ($key)
 
 set ($key, $serialized_value, $ttl=null)
 
 serialize ($value)
 
 getServiceId ()
 
 setServiceId ($service_id)
 
 getComponent ()
 
 setComponent ($component)
 
 isActive ()
 
 isInstallable ()
 
 returnKey ($key)
 
 getInfo ()
 
 getInstallationFailureReason ()
 
 exists ($key)
 
 delete ($key)
 
 flush ($complete=false)
 
 setServiceType ($service_type)
 
 getServiceType ()
 
 setValid ($key)
 Declare a key as valid. More...
 
 setInvalid ($key=null)
 Set the key as invalid. More...
 
 isValid ($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 $cache = array()
 
- Static Protected Attributes inherited from ilGlobalCacheService
static $active = array()
 
static $installable = array()
 

Additional Inherited Members

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

Detailed Description

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 13 of file class.ilStaticCache.php.

Member Function Documentation

◆ delete()

ilStaticCache::delete (   $key)
Parameters
$key
Returns
bool

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

References $key, and ilGlobalCacheService\getComponent().

81  {
82  unset(self::$cache[$this->getComponent()][$key]);
83  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ exists()

ilStaticCache::exists (   $key)
Parameters
$key
Returns
bool

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

References $key, and ilGlobalCacheService\getComponent().

46  {
47  return isset(self::$cache[$this->getComponent()][$key]);
48  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ flush()

ilStaticCache::flush (   $complete = false)
Parameters
bool$complete
Returns
bool

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

References ilGlobalCacheService\getComponent().

90  {
91  if ($complete) {
92  self::$cache = array();
93  } else {
94  unset(self::$cache[$this->getComponent()]);
95  }
96 
97  return true;
98  }
+ Here is the call graph for this function:

◆ get()

ilStaticCache::get (   $key)
Parameters
$key
Returns
mixed

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

References $key, and ilGlobalCacheService\getComponent().

70  {
71  return self::$cache[$this->getComponent()][$key];
72  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ getActive()

ilStaticCache::getActive ( )
protected
Returns
bool

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

20  {
21  return true;
22  }

◆ getInstallable()

ilStaticCache::getInstallable ( )
protected
Returns
bool

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

29  {
30  return true;
31  }

◆ serialize()

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

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

107  {
108  return ($value);
109  }

◆ set()

ilStaticCache::set (   $key,
  $serialized_value,
  $ttl = null 
)
Parameters
$key
$serialized_value
null$ttl
Returns
bool

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

References $key, and ilGlobalCacheService\getComponent().

59  {
60  return self::$cache[$this->getComponent()][$key] = $serialized_value;
61  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ unserialize()

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

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

118  {
119  return ($serialized_value);
120  }

Field Documentation

◆ $cache

ilStaticCache::$cache = array()
staticprotected

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


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