ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
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, $a_int_key1 = null, $a_int_key2 = null,
65  $a_text_key1 = null, $a_text_key2 = null)
66  {
67  global $ilSetting;
68  if(!$this->isDisabled())
69  {
70  parent::storeEntry($a_id, $a_value);
71  }
72  }
73 }
74 ?>
ILIAS Setting Class.
readEntry($a_id)
Read an entry.
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.
__construct()
Constructor.
News cache.
Cache class.
isDisabled()
Check if cache is disabled.
global $ilSetting
Definition: privfeed.php:17
setExpiresAfter($a_val)
Set expires after x seconds.