Elgg  Version 4.3
EventHandlers.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Cache;
4 
11 
17  public static function disable() {
18  _elgg_services()->boot->getCache()->disable();
19  _elgg_services()->plugins->getCache()->disable();
20  _elgg_services()->sessionCache->disable();
21  _elgg_services()->dataCache->disable();
22  _elgg_services()->autoloadManager->getCache()->disable();
23  _elgg_services()->systemCache->getCache()->disable();
24  _elgg_services()->serverCache->getCache()->disable();
25  }
26 
32  public static function enable() {
33  _elgg_services()->boot->getCache()->enable();
34  _elgg_services()->plugins->getCache()->enable();
35  _elgg_services()->sessionCache->enable();
36  _elgg_services()->dataCache->enable();
37  _elgg_services()->autoloadManager->getCache()->enable();
38  _elgg_services()->systemCache->getCache()->enable();
39  }
40 
46  public static function purge() {
47  _elgg_services()->boot->getCache()->purge();
48  _elgg_services()->plugins->getCache()->purge();
49  _elgg_services()->sessionCache->purge();
50  _elgg_services()->dataCache->purge();
51  _elgg_services()->simpleCache->purge();
52  _elgg_services()->fileCache->purge();
53  _elgg_services()->localFileCache->purge();
54  }
55 
61  public static function invalidate() {
62  _elgg_services()->boot->getCache()->invalidate();
63  _elgg_services()->plugins->invalidate();
64  _elgg_services()->sessionCache->invalidate();
65  _elgg_services()->dataCache->invalidate();
66  _elgg_services()->fileCache->invalidate();
67  _elgg_services()->localFileCache->invalidate();
68  }
69 
75  public static function clear() {
76  _elgg_services()->boot->clearCache();
77  _elgg_services()->plugins->clear();
78  _elgg_services()->sessionCache->clear();
79  _elgg_services()->dataCache->clear();
80  _elgg_services()->simpleCache->clear();
81  _elgg_services()->autoloadManager->deleteCache();
82  _elgg_services()->fileCache->clear();
83  _elgg_services()->localFileCache->clear();
84 
85  if (function_exists('opcache_reset')) {
86  opcache_reset();
87  }
88  }
89 }
static enable()
Enables the caches in the system.
static disable()
Disables the caches in the system.
static purge()
Purge the caches in the system.
Contains the cache event handlers.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638
static invalidate()
Invalidates the caches in the system.
static clear()
Invalidates the caches in the system.