ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilShm Class Reference

Class ilShm. More...

+ Inheritance diagram for ilShm:
+ Collaboration diagram for ilShm:

Public Member Functions

 __construct ($service_id, $component)
 
 exists ($key)
 
 set ($key, $serialized_value, $ttl=null)
 
 get ($key)
 
 delete ($key)
 
 flush ()
 
 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 ()
 
 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 ()
 set self::$active More...
 
 getInstallable ()
 set self::$installable More...
 
- Protected Member Functions inherited from ilGlobalCacheService
 getActive ()
 
 getInstallable ()
 
 getMemoryLimit ()
 
 getMinMemory ()
 
 checkMemory ()
 

Static Protected Attributes

static $shm_id = null
 
static $block_size = 0
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilShm::__construct (   $service_id,
  $component 
)
Parameters
$service_id
$component

Definition at line 49 of file class.ilShm.php.

References ilGlobalCacheService\$component, and ilGlobalCacheService\$service_id.

50  {
51  parent::__construct($service_id, $component);
52  self::$shm_id = shmop_open(0xff3, "c", 0644, 100);
53  self::$block_size = shmop_size(self::$shm_id);
54  }

Member Function Documentation

◆ delete()

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

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

References $key.

98  {
99  return shm_remove_var(self::$shm_id, $key);
100  }
$key
Definition: croninfo.php:18

◆ exists()

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

Definition at line 62 of file class.ilShm.php.

References $key.

63  {
64  return shm_has_var(self::$shm_id, $key);
65  }
$key
Definition: croninfo.php:18

◆ flush()

ilShm::flush ( )
Returns
bool

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

References $id.

107  {
108  shmop_delete(self::$id);
109 
110  return true;
111  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ get()

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

Definition at line 86 of file class.ilShm.php.

87  {
88  return shmop_read(self::$shm_id, 0, self::$block_size);
89  }

◆ getActive()

ilShm::getActive ( )
protected

set self::$active

Definition at line 29 of file class.ilShm.php.

30  {
31  self::$active = function_exists('shmop_open');
32  }

◆ getInstallable()

ilShm::getInstallable ( )
protected

set self::$installable

Definition at line 38 of file class.ilShm.php.

39  {
40  return false;
41  self::$active = function_exists('shmop_open');
42  }

◆ serialize()

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

Definition at line 119 of file class.ilShm.php.

120  {
121  return serialize($value);
122  }
serialize($value)

◆ set()

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

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

References $key.

76  {
77  return shmop_write(self::$shm_id, $key, $serialized_value);
78  }
$key
Definition: croninfo.php:18

◆ unserialize()

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

Definition at line 130 of file class.ilShm.php.

131  {
132  return unserialize($serialized_value);
133  }
unserialize($serialized_value)

Field Documentation

◆ $block_size

ilShm::$block_size = 0
staticprotected

Definition at line 23 of file class.ilShm.php.

◆ $shm_id

ilShm::$shm_id = null
staticprotected

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


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