ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Cache\Services Class Reference
+ Collaboration diagram for ILIAS\Cache\Services:

Public Member Functions

 __construct (private ?Config $config=null,)
 
 get (Request $for_container)
 
 flushContainer (Request $container_request)
 
 flushAdapter ()
 

Private Member Functions

 ensureContainer (Request $for_container)
 
 new (Request $for_container)
 
 getAdaptor ()
 

Private Attributes

array $containers = []
 
Adaptor $adaptor = null
 
Factory $adaptor_factory
 

Detailed Description

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

Definition at line 33 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Cache\Services::__construct ( private ?Config  $config = null)

Definition at line 42 of file Services.php.

References null, and ILIAS\Cache\Config\PHPSTATIC.

44  {
45  if ($config === null) {
46  $this->config = new Config(Config::PHPSTATIC, true);
47  }
48  $this->adaptor_factory = new Factory();
49  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Member Function Documentation

◆ ensureContainer()

ILIAS\Cache\Services::ensureContainer ( Request  $for_container)
private

Definition at line 56 of file Services.php.

References ILIAS\Cache\Services\$containers, and ILIAS\Cache\Container\Request\getContainerKey().

Referenced by ILIAS\Cache\Services\flushContainer(), and ILIAS\Cache\Services\get().

56  : Container
57  {
58  if (!array_key_exists($for_container->getContainerKey(), $this->containers)) {
59  $this->containers[$for_container->getContainerKey()] = $this->new($for_container);
60  }
61  return $this->containers[$for_container->getContainerKey()];
62  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flushAdapter()

ILIAS\Cache\Services::flushAdapter ( )

Definition at line 98 of file Services.php.

References ILIAS\Cache\Services\getAdaptor().

98  : void
99  {
100  $this->getAdaptor()->flush();
101  }
+ Here is the call graph for this function:

◆ flushContainer()

ILIAS\Cache\Services::flushContainer ( Request  $container_request)

Definition at line 93 of file Services.php.

References ILIAS\Cache\Services\ensureContainer().

93  : void
94  {
95  $this->ensureContainer($container_request)->flush();
96  }
ensureContainer(Request $for_container)
Definition: Services.php:56
+ Here is the call graph for this function:

◆ get()

ILIAS\Cache\Services::get ( Request  $for_container)

Definition at line 51 of file Services.php.

References ILIAS\Cache\Services\ensureContainer().

51  : Container
52  {
53  return $this->ensureContainer($for_container);
54  }
ensureContainer(Request $for_container)
Definition: Services.php:56
+ Here is the call graph for this function:

◆ getAdaptor()

ILIAS\Cache\Services::getAdaptor ( )
private

Definition at line 85 of file Services.php.

References ILIAS\Cache\Services\$adaptor, and null.

Referenced by ILIAS\Cache\Services\flushAdapter(), and ILIAS\Cache\Services\new().

85  : Adaptor
86  {
87  if ($this->adaptor === null) {
88  $this->adaptor = $this->adaptor_factory->getWithConfig($this->config);
89  }
90  return $this->adaptor;
91  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ new()

ILIAS\Cache\Services::new ( Request  $for_container)
private

Definition at line 64 of file Services.php.

References ILIAS\Cache\Config\ALL, and ILIAS\Cache\Services\getAdaptor().

64  : Container
65  {
66  if (!$this->config->isActivated()) {
67  return new VoidContainer($for_container);
68  }
69 
70  if (
71  $for_container->isForced() === false
72  && !in_array(Config::ALL, $this->config->getActivatedContainerKeys(), true)
73  && !in_array($for_container->getContainerKey(), $this->config->getActivatedContainerKeys(), true)
74  ) {
75  return new VoidContainer($for_container);
76  }
77 
78  return new ActiveContainer(
79  $for_container,
80  $this->getAdaptor(),
81  $this->config
82  );
83  }
+ Here is the call graph for this function:

Field Documentation

◆ $adaptor

Adaptor ILIAS\Cache\Services::$adaptor = null
private

Definition at line 39 of file Services.php.

Referenced by ILIAS\Cache\Services\getAdaptor().

◆ $adaptor_factory

Factory ILIAS\Cache\Services::$adaptor_factory
private

Definition at line 40 of file Services.php.

◆ $containers

array ILIAS\Cache\Services::$containers = []
private

Definition at line 38 of file Services.php.

Referenced by ILIAS\Cache\Services\ensureContainer().


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