ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 34 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 43 of file Services.php.

References ILIAS\Cache\Config\PHPSTATIC.

45  {
46  if ($config === null) {
47  $this->config = new Config(Config::PHPSTATIC, true);
48  }
49  $this->adaptor_factory = new Factory();
50  }

Member Function Documentation

◆ ensureContainer()

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

Definition at line 57 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().

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

◆ flushAdapter()

ILIAS\Cache\Services::flushAdapter ( )

Definition at line 99 of file Services.php.

References ILIAS\Cache\Services\getAdaptor().

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

◆ flushContainer()

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

Definition at line 94 of file Services.php.

References ILIAS\Cache\Services\ensureContainer().

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

◆ get()

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

Definition at line 52 of file Services.php.

References ILIAS\Cache\Services\ensureContainer().

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

◆ getAdaptor()

ILIAS\Cache\Services::getAdaptor ( )
private

Definition at line 86 of file Services.php.

References ILIAS\Cache\Services\$adaptor.

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

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

◆ new()

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

Definition at line 65 of file Services.php.

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

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

Field Documentation

◆ $adaptor

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

Definition at line 40 of file Services.php.

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

◆ $adaptor_factory

Factory ILIAS\Cache\Services::$adaptor_factory
private

Definition at line 41 of file Services.php.

◆ $containers

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

Definition at line 39 of file Services.php.

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


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