ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_once("./Services/Cache/classes/class.ilCache.php");
5
13class ilNewsCache extends ilCache
14{
15 static $disabled = false;
16
23 function __construct()
24 {
25 global $ilSetting;
26
27 $news_set = new ilSetting("news");
28 $news_set->get("acc_cache_mins");
29
30 parent::__construct("ServicesNews", "News", true);
31 $this->setExpiresAfter($news_set->get("acc_cache_mins") * 60);
32 if ((int) $news_set->get("acc_cache_mins") == 0)
33 {
34 self::$disabled = true;
35 }
36 }
37
42 public function isDisabled()
43 {
44 return self::$disabled or parent::isDisabled();
45 }
46
47
51 function readEntry($a_id)
52 {
53 if (!$this->isDisabled())
54 {
55 return parent::readEntry($a_id);
56 }
57 return false;
58 }
59
60
64 function storeEntry($a_id, $a_value)
65 {
66 global $ilSetting;
67 if(!$this->isDisabled())
68 {
69 parent::storeEntry($a_id, $a_value);
70 }
71 }
72}
73?>
Cache class.
setExpiresAfter($a_val)
Set expires after x seconds.
storeEntry($a_id, $a_value)
Id is user_id:ref_id, we store ref_if additionally.
isDisabled()
Check if cache is disabled.
readEntry($a_id)
Read an entry.
__construct()
Constructor.
ILIAS Setting Class.
global $ilSetting
Definition: privfeed.php:40