ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilNewsCache.php
Go to the documentation of this file.
1<?php
2
24class ilNewsCache extends ilCache
25{
27 public static bool $disabled = false;
28
29 public function __construct()
30 {
31 global $DIC;
32
33 $this->settings = $DIC->settings();
34 $news_set = new ilSetting("news");
35
36 parent::__construct("ServicesNews", "News", true);
37 $this->setExpiresAfter($news_set->get("acc_cache_mins") * 60);
38 if ((int) $news_set->get("acc_cache_mins") === 0) {
39 self::$disabled = true;
40 }
41 }
42
43 public function isDisabled(): bool
44 {
45 return self::$disabled || parent::isDisabled();
46 }
47
48 protected function readEntry(string $a_id): bool
49 {
50 if (!$this->isDisabled()) {
51 return parent::readEntry($a_id);
52 }
53 return false;
54 }
55
59 public function storeEntry(
60 string $a_id,
61 string $a_value,
62 ?int $a_int_key1 = null,
63 ?int $a_int_key2 = null,
64 ?string $a_text_key1 = null,
65 ?string $a_text_key2 = null
66 ): void {
67 if (!$this->isDisabled()) {
68 parent::storeEntry($a_id, $a_value);
69 }
70 }
71}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setExpiresAfter(int $a_val)
Set expires after x seconds.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isDisabled()
Check if cache is disabled Forced if member view is active.
storeEntry(string $a_id, string $a_value, ?int $a_int_key1=null, ?int $a_int_key2=null, ?string $a_text_key1=null, ?string $a_text_key2=null)
Id is user_id:ref_id, we store ref_if additionally.
readEntry(string $a_id)
ilSetting $settings
static bool $disabled
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26