ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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 ()
 getServiceId ()
 setServiceId ($service_id)
 setValid ($key)
 getComponent ()
 setComponent ($component)
 setInvalid ($key=NULL)
 isValid ($key)
 isActive ()
 isInstallable ()
 returnKey ($key)
 getInstallationFailureReason ()
 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 ()
 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

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

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

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

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

ilXcache::flush ( )
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
$_SERVER["PHP_AUTH_USER"] = "xcache";
$_SERVER["PHP_AUTH_PW"] = "xcache";
xcache_clear_cache(XC_TYPE_VAR, 0);
return true;
}
ilXcache::get (   $key)
Parameters
$key
Returns
mixed

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

ilXcache::getActive ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\$active.

{
$function_exists = function_exists('xcache_set');
$var_size = ini_get('xcache.var_size') != '0M';
$var_count = ini_get('xcache.var_count') > 0;
$api = (php_sapi_name() !== 'cli');
$active = $function_exists AND $var_size AND $var_count AND $api;
return $active;
}
ilXcache::getInfo ( )
Returns
array

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\isActive().

{
if ($this->isActive()) {
return xcache_info(XC_TYPE_VAR, 0);
}
}

+ Here is the call graph for this function:

ilXcache::getInstallable ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
return function_exists('xcache_set');
}
ilXcache::getMemoryLimit ( )
protected
Returns
int|string

Reimplemented from ilGlobalCacheService.

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

{
return ini_get('xcache.var_size');
}
ilXcache::getMinMemory ( )
protected
Returns
int

Reimplemented from ilGlobalCacheService.

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

References MIN_MEMORY.

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

Reimplemented from ilGlobalCacheService.

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

{
return serialize($value);
}
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.

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

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

Reimplemented from ilGlobalCacheService.

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

{
return unserialize($serialized_value);
}

Field Documentation

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: