ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 ()
 Check if cache is disabled Forced if member view is active. More...
 
 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
Deprecated:
Use \ILIAS\News\Persistence\NewsCache instead

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

Constructor & Destructor Documentation

◆ __construct()

ilNewsCache::__construct ( )

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

32 {
33 global $DIC;
34
35 $this->settings = $DIC->settings();
36 $news_set = new ilSetting("news");
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 }
setExpiresAfter(int $a_val)
Set expires after x seconds.
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ isDisabled()

ilNewsCache::isDisabled ( )

Check if cache is disabled Forced if member view is active.

Reimplemented from ilCache.

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

45 : bool
46 {
47 return self::$disabled || parent::isDisabled();
48 }

Referenced by readEntry().

+ Here is the caller graph for this function:

◆ readEntry()

ilNewsCache::readEntry ( string  $a_id)
protected

Reimplemented from ilCache.

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

50 : bool
51 {
52 if (!$this->isDisabled()) {
53 return parent::readEntry($a_id);
54 }
55 return false;
56 }
isDisabled()
Check if cache is disabled Forced if member view is active.

References isDisabled().

+ 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.

Reimplemented from ilCache.

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

68 : void {
69 if (!$this->isDisabled()) {
70 parent::storeEntry($a_id, $a_value);
71 }
72 }

Field Documentation

◆ $disabled

bool ilNewsCache::$disabled = false
static

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

◆ $settings

ilSetting ilNewsCache::$settings
protected

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


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