ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.MemorySetting.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Administration;
22
28class MemorySetting implements Setting
29{
30 protected static array $setting = [];
31 public string $module = "";
32
33 public function __construct(
34 string $a_module = "common"
35 ) {
36 $this->module = $a_module;
37 }
38
39 public function clear(): void
40 {
41 self::$setting = [];
42 }
43
44 public function getModule(): string
45 {
46 return $this->module;
47 }
48
49 public function read(): void
50 {
51 }
52
53 public function get(
54 string $a_keyword,
55 ?string $a_default_value = null
56 ): ?string {
57 if ($a_keyword === "ilias_version") {
58 return ILIAS_VERSION;
59 }
60 return self::$setting[$this->module][$a_keyword] ??
61 $a_default_value;
62 }
63
64 public function deleteAll(): void
65 {
66 if (isset(self::$setting[$this->module])) {
67 self::$setting[$this->module] = array();
68 }
69 }
70
71 public function delete(string $a_keyword): void
72 {
73 unset(self::$setting[$this->module][$a_keyword]);
74 }
75
76 public function getAll(): array
77 {
78 return self::$setting[$this->module] ?? [];
79 }
80
81 public function set(string $a_key, string $a_val): void
82 {
83 $this->delete($a_key);
84 self::$setting[$this->module][$a_key] = $a_val;
85 }
86
87 public static function _lookupValue(
88 string $a_module,
89 string $a_keyword
90 ): ?string {
91 return self::$setting[$a_module][$a_keyword] ?? null;
92 }
93}
__construct(string $a_module="common")
static _lookupValue(string $a_module, string $a_keyword)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ILIAS_VERSION