Elgg  Version master
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()->accessCache->disable();
19  _elgg_services()->autoloadCache->disable();
20  _elgg_services()->bootCache->disable();
21  _elgg_services()->metadataCache->disable();
22  _elgg_services()->pluginsCache->disable();
23  _elgg_services()->systemCache->disable();
24  _elgg_services()->serverCache->disable();
25  }
26 
32  public static function enable() {
33  _elgg_services()->accessCache->enable();
34  _elgg_services()->autoloadCache->enable();
35  _elgg_services()->bootCache->enable();
36  _elgg_services()->metadataCache->enable();
37  _elgg_services()->pluginsCache->enable();
38  _elgg_services()->systemCache->enable();
39  _elgg_services()->serverCache->enable();
40  }
41 
47  public static function purge() {
48  _elgg_services()->accessCache->purge();
49  _elgg_services()->autoloadCache->purge();
50  _elgg_services()->bootCache->purge();
51  _elgg_services()->metadataCache->purge();
52  _elgg_services()->pluginsCache->purge();
53  _elgg_services()->simpleCache->purge();
54  _elgg_services()->systemCache->purge();
55  _elgg_services()->serverCache->purge();
56  }
57 
63  public static function invalidate() {
64  _elgg_services()->accessCache->invalidate();
65  _elgg_services()->autoloadCache->invalidate();
66  _elgg_services()->bootCache->invalidate();
67  _elgg_services()->metadataCache->invalidate();
68  _elgg_services()->pluginsCache->invalidate();
69  _elgg_services()->systemCache->invalidate();
70  _elgg_services()->serverCache->invalidate();
71  }
72 
78  public static function clear() {
79  _elgg_services()->accessCache->clear();
80  _elgg_services()->autoloadManager->deleteCache();
81  _elgg_services()->boot->clearCache();
82  _elgg_services()->metadataCache->clear();
83  _elgg_services()->pluginsCache->clear();
84  _elgg_services()->simpleCache->clear();
85  _elgg_services()->systemCache->clear();
86  _elgg_services()->serverCache->clear();
87 
88  if (function_exists('opcache_reset')) {
89  opcache_reset();
90  }
91  }
92 }
Contains the cache event handlers.
static invalidate()
Invalidates the caches in the system.
static purge()
Purge the caches in the system.
static clear()
Invalidates the caches in the system.
static enable()
Enables the caches in the system.
static disable()
Disables the caches in the system.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:353