ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilGlobalCacheAllFlushedObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
22
24{
25 public function __construct(private \ilGlobalCacheSettingsAdapter $cache_settings_adapter)
26 {
27 }
28
29 public function getHash(): string
30 {
31 return hash("sha256", self::class);
32 }
33
34 public function getLabel(): string
35 {
36 return "All global caches flushed";
37 }
38
39 public function isNotable(): bool
40 {
41 return true;
42 }
43
44 public function getPreconditions(Environment $environment): array
45 {
46 return [
48 ];
49 }
50
51 public function achieve(Environment $environment): Environment
52 {
53 $client_ini = $environment->getResource(Environment::RESOURCE_CLIENT_INI);
54 if ($client_ini === null) {
55 throw new UnexpectedValueException("Client ini not found");
56 }
57 $this->cache_settings_adapter->readFromIniFile($client_ini);
58 $services = new Services($this->cache_settings_adapter->getConfig());
59 $services->flushAdapter();
60
61 return $environment;
62 }
63
67 public function isApplicable(Environment $environment): bool
68 {
69 return true;
70 }
71}
__construct(private \ilGlobalCacheSettingsAdapter $cache_settings_adapter)
isApplicable(Environment $environment)
@inheritDoc
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.