ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Cache\Adaptor\BaseAdaptor Class Reference
+ Inheritance diagram for ILIAS\Cache\Adaptor\BaseAdaptor:
+ Collaboration diagram for ILIAS\Cache\Adaptor\BaseAdaptor:

Public Member Functions

 __construct (protected Config $config)
 
- Public Member Functions inherited from ILIAS\Cache\Adaptor\Adaptor\Adaptor
 __construct (Config $config)
 
 isAvailable ()
 
 has (string $container, string $key)
 
 get (string $container, string $key)
 
 set (string $container, string $key, string $value, int $ttl)
 
 delete (string $container, string $key)
 
 flushContainer (string $container)
 
 flush ()
 

Protected Member Functions

 buildKey (string $container, string $key)
 
 buildContainerPrefix (string $container)
 

Protected Attributes

const LOCK_UNTIL = '_lock_until'
 

Private Attributes

string $instance_prefix
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Cache\Adaptor\Adaptor\Adaptor
const CONTAINER_PREFIX_SEPARATOR = ':'
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 28 of file BaseAdaptor.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Cache\Adaptor\BaseAdaptor::__construct ( protected Config  $config)

Definition at line 33 of file BaseAdaptor.php.

34  {
35  // generates a unique prefix for the current instance. this is only to prevent collisions when running multiple
36  // ILIAS Instances on the same server. It uses the md5 hash of the current working directory and takes the first
37  // 6 characters. This is not a secure way to generate a prefix, but it is sufficient for this purpose.
38  // It's highly unlikely that two paths will result in the same prefix.
39  $this->instance_prefix = substr(md5(getcwd()), 0, 6);
40  }

Member Function Documentation

◆ buildContainerPrefix()

ILIAS\Cache\Adaptor\BaseAdaptor::buildContainerPrefix ( string  $container)
protected

Definition at line 47 of file BaseAdaptor.php.

Referenced by ILIAS\Cache\Adaptor\BaseAdaptor\buildKey(), ILIAS\Cache\Adaptor\APCu\flushContainer(), and ILIAS\Cache\Adaptor\Memcached\flushContainer().

47  : string
48  {
49  return $this->instance_prefix . self::CONTAINER_PREFIX_SEPARATOR . $container . self::CONTAINER_PREFIX_SEPARATOR;
50  }
$container
Definition: wac.php:36
+ Here is the caller graph for this function:

◆ buildKey()

ILIAS\Cache\Adaptor\BaseAdaptor::buildKey ( string  $container,
string  $key 
)
protected

Field Documentation

◆ $instance_prefix

string ILIAS\Cache\Adaptor\BaseAdaptor::$instance_prefix
private

Definition at line 31 of file BaseAdaptor.php.

◆ LOCK_UNTIL

const ILIAS\Cache\Adaptor\BaseAdaptor::LOCK_UNTIL = '_lock_until'
protected

Definition at line 30 of file BaseAdaptor.php.


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