ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilGlobalCacheAllFlushedObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
__construct(private \ilGlobalCacheSettingsAdapter $cache_settings_adapter)