ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilNewsCache Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilNewsCache:
+ Collaboration diagram for ilNewsCache:

Public Member Functions

 __construct ()
 
 isDisabled ()
 
 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. More...
 
- Public Member Functions inherited from ilCache
 __construct (string $a_component, string $a_cache_name, bool $a_use_long_content=false)
 
 isDisabled ()
 Check if cache is disabled Forced if member view is active. More...
 
 setComponent (string $a_val)
 
 setExpiresAfter (int $a_val)
 Set expires after x seconds. More...
 
 getExpiresAfter ()
 
 getEntry (string $a_id)
 
 getLastAccessStatus ()
 
 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)
 
 deleteByAdditionalKeys (?int $a_int_key1=null, ?int $a_int_key2=null, ?string $a_text_key1=null, ?string $a_text_key2=null)
 
 deleteAllEntries ()
 
 deleteEntry (string $a_id)
 

Static Public Attributes

static bool $disabled = false
 

Protected Member Functions

 readEntry (string $a_id)
 
- Protected Member Functions inherited from ilCache
 getComponent ()
 
 setName (string $a_val)
 
 getName ()
 
 setUseLongContent (bool $a_val)
 
 getUseLongContent ()
 
 readEntry (string $a_id)
 

Protected Attributes

ilSetting $settings
 
- Protected Attributes inherited from ilCache
string $entry
 
string $last_access
 
int $expires_after
 
bool $use_long_content
 
string $name
 
string $component
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning News cache

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilNewsCache.php.

Constructor & Destructor Documentation

◆ __construct()

ilNewsCache::__construct ( )

Definition at line 29 of file class.ilNewsCache.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilCache\setExpiresAfter(), and ILIAS\Repository\settings().

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  }
global $DIC
Definition: feed.php:28
setExpiresAfter(int $a_val)
Set expires after x seconds.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ isDisabled()

ilNewsCache::isDisabled ( )

Definition at line 43 of file class.ilNewsCache.php.

Referenced by readEntry(), and storeEntry().

43  : bool
44  {
45  return self::$disabled || parent::isDisabled();
46  }
+ Here is the caller graph for this function:

◆ readEntry()

ilNewsCache::readEntry ( string  $a_id)
protected

Definition at line 48 of file class.ilNewsCache.php.

References isDisabled().

48  : bool
49  {
50  if (!$this->isDisabled()) {
51  return parent::readEntry($a_id);
52  }
53  return false;
54  }
+ Here is the call graph for this function:

◆ storeEntry()

ilNewsCache::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.

Definition at line 59 of file class.ilNewsCache.php.

References isDisabled().

66  : void {
67  if (!$this->isDisabled()) {
68  parent::storeEntry($a_id, $a_value);
69  }
70  }
+ Here is the call graph for this function:

Field Documentation

◆ $disabled

bool ilNewsCache::$disabled = false
static

Definition at line 27 of file class.ilNewsCache.php.

◆ $settings

ilSetting ilNewsCache::$settings
protected

Definition at line 26 of file class.ilNewsCache.php.


The documentation for this class was generated from the following file: