ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilNewsCache.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once(
"./Services/Cache/classes/class.ilCache.php"
);
5
13
class
ilNewsCache
extends
ilCache
14
{
18
protected
$settings
;
19
20
public
static
$disabled
=
false
;
21
28
public
function
__construct
()
29
{
30
global
$DIC
;
31
32
$this->
settings
= $DIC->settings();
33
$ilSetting
= $DIC->settings();
34
35
$news_set =
new
ilSetting
(
"news"
);
36
$news_set->get(
"acc_cache_mins"
);
37
38
parent::__construct(
"ServicesNews"
,
"News"
,
true
);
39
$this->
setExpiresAfter
($news_set->get(
"acc_cache_mins"
) * 60);
40
if
((
int
) $news_set->get(
"acc_cache_mins"
) == 0) {
41
self::$disabled =
true
;
42
}
43
}
44
49
public
function
isDisabled
()
50
{
51
return
self::$disabled
or
parent::isDisabled();
52
}
53
54
58
public
function
readEntry
($a_id)
59
{
60
if
(!$this->
isDisabled
()) {
61
return
parent::readEntry($a_id);
62
}
63
return
false
;
64
}
65
66
70
public
function
storeEntry
(
71
$a_id,
72
$a_value,
73
$a_int_key1 = null,
74
$a_int_key2 = null,
75
$a_text_key1 = null,
76
$a_text_key2 = null
77
) {
78
$ilSetting
=
$this->settings
;
79
if
(!$this->
isDisabled
()) {
80
parent::storeEntry($a_id, $a_value);
81
}
82
}
83
}
ilNewsCache\readEntry
readEntry($a_id)
Read an entry.
Definition:
class.ilNewsCache.php:58
settings
settings()
Definition:
settings.php:2
ilNewsCache\storeEntry
storeEntry( $a_id, $a_value, $a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
Id is user_id:ref_id, we store ref_if additionally.
Definition:
class.ilNewsCache.php:70
ilNewsCache\__construct
__construct()
Constructor.
Definition:
class.ilNewsCache.php:28
$DIC
global $DIC
Definition:
saml.php:7
ilNewsCache\$settings
$settings
Definition:
class.ilNewsCache.php:18
ilNewsCache
News cache.
Definition:
class.ilNewsCache.php:13
ilCache
Cache class.
Definition:
class.ilCache.php:18
ilNewsCache\$disabled
static $disabled
Definition:
class.ilNewsCache.php:20
ilNewsCache\isDisabled
isDisabled()
Check if cache is disabled.
Definition:
class.ilNewsCache.php:49
$ilSetting
global $ilSetting
Definition:
privfeed.php:17
php
ilCache\setExpiresAfter
setExpiresAfter($a_val)
Set expires after x seconds.
Definition:
class.ilCache.php:109
or
ilSetting
Services
News
classes
class.ilNewsCache.php
Generated on Thu Jan 16 2025 19:02:26 for ILIAS by
1.8.13 (using
Doxyfile
)