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

Protected Member Functions

 getActive ()
 set self::$active
 getInstallable ()
 set self::$installable
- Protected Member Functions inherited from ilGlobalCacheService
 saveValid ()
 readValid ()
 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

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

Reimplemented from ilGlobalCacheService.

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

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

{
self::$shm_id = shmop_open(0xff3, "c", 0644, 100);
self::$block_size = shmop_size(self::$shm_id);
}

Member Function Documentation

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

Reimplemented from ilGlobalCacheService.

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

{
return shm_remove_var(self::$shm_id, $key);
}
ilShm::exists (   $key)
Parameters
$key
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
return shm_has_var(self::$shm_id, $key);
}
ilShm::flush ( )
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
shmop_delete(self::$id);
return true;
}
ilShm::get (   $key)
Parameters
$key
Returns
mixed

Reimplemented from ilGlobalCacheService.

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

{
return shmop_read(self::$shm_id, 0, self::$block_size);
}
ilShm::getActive ( )
protected

set self::$active

Reimplemented from ilGlobalCacheService.

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

{
self::$active = function_exists('shmop_open');
}
ilShm::getInstallable ( )
protected

set self::$installable

Reimplemented from ilGlobalCacheService.

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

{
return false;
self::$active = function_exists('shmop_open');
}
ilShm::serialize (   $value)
Parameters
$value
Returns
mixed

Reimplemented from ilGlobalCacheService.

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

{
return serialize($value);
}
ilShm::set (   $key,
  $serialized_value,
  $ttl = NULL 
)
Parameters
$key
$serialized_value
null$ttl
Returns
bool

Reimplemented from ilGlobalCacheService.

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

{
return shmop_write(self::$shm_id, $key, $serialized_value);
}
ilShm::unserialize (   $serialized_value)
Parameters
$serialized_value
Returns
mixed

Reimplemented from ilGlobalCacheService.

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

{
return unserialize($serialized_value);
}

Field Documentation

ilShm::$block_size = 0
staticprotected

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

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: