ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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)
65  {
66  global $ilSetting;
67  if(!$this->isDisabled())
68  {
69  parent::storeEntry($a_id, $a_value);
70  }
71  }
72 }
73 ?>