ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 46 of file class.ilShm.php.

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

46  {
47  parent::__construct($service_id, $component);
48  self::$shm_id = shmop_open(0xff3, "c", 0644, 100);
49  self::$block_size = shmop_size(self::$shm_id);
50  }

Member Function Documentation

◆ delete()

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

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

90  {
91  return shm_remove_var(self::$shm_id, $key);
92  }

◆ exists()

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

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

58  {
59  return shm_has_var(self::$shm_id, $key);
60  }

◆ flush()

ilShm::flush ( )
Returns
bool

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

98  {
99  shmop_delete(self::$id);
100 
101  return true;
102  }

◆ get()

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

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

80  {
81  return shmop_read(self::$shm_id, 0, self::$block_size);
82  }

◆ getActive()

ilShm::getActive ( )
protected

set self::$active

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

28  {
29  self::$active = function_exists('shmop_open');
30  }

◆ getInstallable()

ilShm::getInstallable ( )
protected

set self::$installable

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

36  {
37  return false;
38  self::$active = function_exists('shmop_open');
39  }

◆ serialize()

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

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

110  {
111  return serialize($value);
112  }
serialize($value)

◆ set()

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

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

70  {
71  return shmop_write(self::$shm_id, $key, $serialized_value);
72  }

◆ unserialize()

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

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

120  {
121  return unserialize($serialized_value);
122  }
unserialize($serialized_value)

Field Documentation

◆ $block_size

ilShm::$block_size = 0
staticprotected

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

◆ $shm_id

ilShm::$shm_id = null
staticprotected

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


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