ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

Reimplemented from ilGlobalCacheService.

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

52 {
53 return xcache_unset($this->returnKey($key));
54 }

References ilGlobalCacheService\returnKey().

+ Here is the call graph for this function:

◆ exists()

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

Reimplemented from ilGlobalCacheService.

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

20 {
21 return xcache_isset($this->returnKey($key));
22 }

References ilGlobalCacheService\returnKey().

+ Here is the call graph for this function:

◆ flush()

ilXcache::flush ( )
Returns
bool

Reimplemented from ilGlobalCacheService.

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 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER.

◆ get()

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

Reimplemented from ilGlobalCacheService.

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

42 {
43 return xcache_get($this->returnKey($key));
44 }

References ilGlobalCacheService\returnKey().

+ Here is the call graph for this function:

◆ getActive()

ilXcache::getActive ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

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

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 }

References ilGlobalCacheService\$active.

◆ getInfo()

ilXcache::getInfo ( )
Returns
array

Reimplemented from ilGlobalCacheService.

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

116 {
117 if ($this->isActive()) {
118 return xcache_info(XC_TYPE_VAR, 0);
119 }
120 }

References ilGlobalCacheService\isActive().

+ Here is the call graph for this function:

◆ getInstallable()

ilXcache::getInstallable ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

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

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

◆ getMemoryLimit()

ilXcache::getMemoryLimit ( )
protected
Returns
int|string

Reimplemented from ilGlobalCacheService.

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

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

◆ getMinMemory()

ilXcache::getMinMemory ( )
protected
Returns
int

Reimplemented from ilGlobalCacheService.

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

134 {
135 return self::MIN_MEMORY;
136 }
const MIN_MEMORY

References MIN_MEMORY.

◆ serialize()

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

Reimplemented from ilGlobalCacheService.

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

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

References serialize().

Referenced by serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

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

Reimplemented from ilGlobalCacheService.

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

32 {
33 return xcache_set($this->returnKey($key), $serialized_value, $ttl);
34 }

References ilGlobalCacheService\returnKey().

+ Here is the call graph for this function:

◆ unserialize()

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

Reimplemented from ilGlobalCacheService.

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

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

References unserialize().

Referenced by unserialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ MIN_MEMORY

const ilXcache::MIN_MEMORY = 32

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

Referenced by getMinMemory().


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