ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilXcache Class Reference

Class ilXcache. More...

+ Inheritance diagram for ilXcache:
+ Collaboration diagram for ilXcache:

Public Member Functions

 exists ($key)
 
 set ($key, $serialized_value, $ttl=NULL)
 
 get ($key)
 
 delete ($key)
 
 flush ()
 
 serialize ($value)
 
 unserialize ($serialized_value)
 
 getInfo ()
 
- Public Member Functions inherited from ilGlobalCacheService
 __construct ($service_id, $component)
 
 __destruct ()
 
 unserialize ($serialized_value)
 
 get ($key)
 
 set ($key, $serialized_value, $ttl=NULL)
 
 serialize ($value)
 
 getServiceId ()
 
 setServiceId ($service_id)
 
 setValid ($key)
 
 getComponent ()
 
 setComponent ($component)
 
 setInvalid ($key=NULL)
 
 isValid ($key)
 
 isActive ()
 
 isInstallable ()
 
 returnKey ($key)
 
 getInfo ()
 
 getInstallationFailureReason ()
 
 exists ($key)
 
 delete ($key)
 
 flush ()
 
 setServiceType ($service_type)
 
 getServiceType ()
 

Data Fields

const MIN_MEMORY = 32
 

Protected Member Functions

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

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 = ''
 
- Static Protected Attributes inherited from ilGlobalCacheService
static $active = array()
 
static $installable = array()
 

Detailed Description

Class ilXcache.

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

Definition at line 10 of file class.ilXcache.php.

Member Function Documentation

◆ delete()

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

Definition at line 52 of file class.ilXcache.php.

References ilGlobalCacheService\returnKey().

52  {
53  return xcache_unset($this->returnKey($key));
54  }
+ Here is the call graph for this function:

◆ exists()

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

Definition at line 20 of file class.ilXcache.php.

References ilGlobalCacheService\returnKey().

20  {
21  return xcache_isset($this->returnKey($key));
22  }
+ Here is the call graph for this function:

◆ flush()

ilXcache::flush ( )
Returns
bool

Definition at line 60 of file class.ilXcache.php.

60  {
61  $_SERVER["PHP_AUTH_USER"] = "xcache";
62  $_SERVER["PHP_AUTH_PW"] = "xcache";
63 
64  xcache_clear_cache(XC_TYPE_VAR, 0);
65 
66  return true;
67  }

◆ get()

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

Definition at line 42 of file class.ilXcache.php.

References ilGlobalCacheService\returnKey().

42  {
43  return xcache_get($this->returnKey($key));
44  }
+ Here is the call graph for this function:

◆ getActive()

ilXcache::getActive ( )
protected
Returns
bool

Definition at line 93 of file class.ilXcache.php.

References ilGlobalCacheService\$active.

93  {
94  $function_exists = function_exists('xcache_set');
95  $var_size = ini_get('xcache.var_size') != '0M';
96  $var_count = ini_get('xcache.var_count') > 0;
97  $api = (php_sapi_name() !== 'cli');
98 
99  $active = $function_exists AND $var_size AND $var_count AND $api;
100 
101  return $active;
102  }

◆ getInfo()

ilXcache::getInfo ( )
Returns
array

Definition at line 116 of file class.ilXcache.php.

References ilGlobalCacheService\isActive().

116  {
117  if ($this->isActive()) {
118  return xcache_info(XC_TYPE_VAR, 0);
119  }
120  }
+ Here is the call graph for this function:

◆ getInstallable()

ilXcache::getInstallable ( )
protected
Returns
bool

Definition at line 108 of file class.ilXcache.php.

108  {
109  return function_exists('xcache_set');
110  }

◆ getMemoryLimit()

ilXcache::getMemoryLimit ( )
protected
Returns
int|string

Definition at line 126 of file class.ilXcache.php.

126  {
127  return ini_get('xcache.var_size');
128  }

◆ getMinMemory()

ilXcache::getMinMemory ( )
protected
Returns
int

Definition at line 134 of file class.ilXcache.php.

134  {
135  return self::MIN_MEMORY;
136  }

◆ serialize()

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

Definition at line 75 of file class.ilXcache.php.

75  {
76  return serialize($value);
77  }
serialize($value)

◆ set()

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

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

References ilGlobalCacheService\returnKey().

32  {
33  return xcache_set($this->returnKey($key), $serialized_value, $ttl);
34  }
+ Here is the call graph for this function:

◆ unserialize()

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

Definition at line 85 of file class.ilXcache.php.

85  {
86  return unserialize($serialized_value);
87  }
unserialize($serialized_value)

Field Documentation

◆ MIN_MEMORY

const ilXcache::MIN_MEMORY = 32

Definition at line 12 of file class.ilXcache.php.


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