ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilApc Class Reference

Class ilApc. More...

+ Inheritance diagram for ilApc:
+ Collaboration diagram for ilApc:

Public Member Functions

 exists ($key)
 set ($key, $serialized_value, $ttl=0)
 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 = 128
const CACHE_ID = 'user'

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 ilApc.

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

Definition at line 14 of file class.ilApc.php.

Member Function Documentation

ilApc::delete (   $key)
Parameters
$key
Returns
bool|string[]

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

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

Reimplemented from ilGlobalCacheService.

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

References ilGlobalCacheService\returnKey().

{
if (function_exists('apc_exists')) {
return apc_exists($this->returnKey($key));
} else {
return apc_fetch($this->returnKey($key)) !== NULL;
}
}

+ Here is the call graph for this function:

ilApc::flush ( )
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
return apc_clear_cache(self::CACHE_ID);
}
ilApc::get (   $key)
Parameters
$key
Returns
mixed

Reimplemented from ilGlobalCacheService.

Definition at line 51 of file class.ilApc.php.

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

ilApc::getActive ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

Definition at line 127 of file class.ilApc.php.

{
return function_exists('apc_store');
}
ilApc::getInfo ( )
Returns
array

Reimplemented from ilGlobalCacheService.

Definition at line 97 of file class.ilApc.php.

References ilGlobalCacheService\getComponent(), and ilGlobalCacheService\getServiceId().

{
$return = array();
$cache_info = apc_cache_info();
unset($cache_info['cache_list']);
unset($cache_info['slot_distribution']);
$return['__cache_info'] = array(
'apc.enabled' => ini_get('apc.enabled'),
'apc.shm_size' => ini_get('apc.shm_size'),
'apc.shm_segments' => ini_get('apc.shm_segments'),
'apc.gc_ttl' => ini_get('apc.gc_ttl'),
'apc.user_ttl' => ini_get('apc.ttl'),
'info' => $cache_info
);
$cache_info = apc_cache_info();
foreach ($cache_info['cache_list'] as $dat) {
$key = $dat['key'];
if (preg_match('/' . $this->getServiceId() . '_' . $this->getComponent() . '/', $key)) {
$return[$key] = apc_fetch($key);
}
}
return $return;
}

+ Here is the call graph for this function:

ilApc::getInstallable ( )
protected
Returns
bool

Reimplemented from ilGlobalCacheService.

Definition at line 135 of file class.ilApc.php.

{
return function_exists('apc_store');
}
ilApc::getMemoryLimit ( )
protected
Returns
string

Reimplemented from ilGlobalCacheService.

Definition at line 143 of file class.ilApc.php.

References ilRuntime\getInstance(), and getMinMemory().

{
if (ilRuntime::getInstance()->isHHVM()) {
return $this->getMinMemory() . 'M';
}
return ini_get('apc.shm_size');
}

+ Here is the call graph for this function:

ilApc::getMinMemory ( )
protected
Returns
int

Reimplemented from ilGlobalCacheService.

Definition at line 155 of file class.ilApc.php.

References MIN_MEMORY.

Referenced by getMemoryLimit().

{
}

+ Here is the caller graph for this function:

ilApc::serialize (   $value)
Parameters
$value
Returns
mixed|string

Reimplemented from ilGlobalCacheService.

Definition at line 79 of file class.ilApc.php.

{
return ($value);
}
ilApc::set (   $key,
  $serialized_value,
  $ttl = 0 
)
Parameters
$key
$serialized_value
int$ttl
Returns
array|bool

Reimplemented from ilGlobalCacheService.

Definition at line 41 of file class.ilApc.php.

References ilGlobalCacheService\returnKey().

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

+ Here is the call graph for this function:

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

Reimplemented from ilGlobalCacheService.

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

{
return ($serialized_value);
}

Field Documentation

const ilApc::CACHE_ID = 'user'

Definition at line 17 of file class.ilApc.php.

const ilApc::MIN_MEMORY = 128

Definition at line 16 of file class.ilApc.php.

Referenced by getMinMemory().


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