ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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

References ILIAS\Cache\Config\PHPSTATIC.

Member Function Documentation

◆ ensureContainer()

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

Definition at line 56 of file Services.php.

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 }

References ILIAS\Cache\Container\Request\getContainerKey().

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

+ 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.

98 : void
99 {
100 $this->getAdaptor()->flush();
101 }

References ILIAS\Cache\Services\getAdaptor().

+ Here is the call graph for this function:

◆ flushContainer()

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

Definition at line 93 of file Services.php.

93 : void
94 {
95 $this->ensureContainer($container_request)->flush();
96 }
ensureContainer(Request $for_container)
Definition: Services.php:56

References ILIAS\Cache\Services\ensureContainer().

+ Here is the call graph for this function:

◆ get()

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

Definition at line 51 of file Services.php.

51 : Container
52 {
53 return $this->ensureContainer($for_container);
54 }

References ILIAS\Cache\Services\ensureContainer().

Referenced by ILIAS\Test\Results\Data\Repository\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdaptor()

ILIAS\Cache\Services::getAdaptor ( )
private

Definition at line 85 of file Services.php.

85 : Adaptor
86 {
87 if ($this->adaptor === null) {
88 $this->adaptor = $this->adaptor_factory->getWithConfig($this->config);
89 }
90 return $this->adaptor;
91 }

References ILIAS\Cache\Services\$adaptor.

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

+ 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.

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 }

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

+ 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.


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