Elgg  Version 6.1
cache.php
Go to the documentation of this file.
1 <?php
16 function elgg_save_system_cache(string $type, $data, int $expire_after = null): bool {
17  return _elgg_services()->systemCache->save($type, $data, $expire_after);
18 }
19 
27 function elgg_load_system_cache(string $type) {
28  return _elgg_services()->systemCache->load($type);
29 }
30 
38 function elgg_delete_system_cache(string $type): bool {
39  return _elgg_services()->systemCache->delete($type);
40 }
41 
42 /* Simplecache */
43 
59 function elgg_register_simplecache_view(string $view_name): void {
60  _elgg_services()->simpleCache->registerCacheableView($view_name);
61 }
62 
78 function elgg_get_simplecache_url(string $view): string {
79  return _elgg_services()->simpleCache->getUrl($view);
80 }
81 
89  // this event sequence could take while, make sure there is no timeout
90  set_time_limit(0);
91 
92  _elgg_services()->config->save('lastcache', time());
93 
94  _elgg_services()->events->triggerSequence('cache:invalidate', 'system');
95 }
96 
103 function elgg_clear_caches(): void {
104  // this event sequence could take while, make sure there is no timeout
105  set_time_limit(0);
106 
107  _elgg_services()->events->triggerSequence('cache:clear', 'system');
108 }
109 
118 function elgg_purge_caches(): void {
119  // this event sequence could take while, make sure there is no timeout
120  set_time_limit(0);
121 
122  _elgg_services()->events->triggerSequence('cache:purge', 'system');
123 }
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
$type
Definition: delete.php:21
elgg_invalidate_caches()
Invalidate all the registered caches.
Definition: cache.php:88
elgg_purge_caches()
Purge all the registered caches.
Definition: cache.php:118
if(!$entity instanceof\ElggUser) $data
Definition: attributes.php:13
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
Definition: upload.php:39
elgg_delete_system_cache(string $type)
Deletes the contents of a system cache.
Definition: cache.php:38
elgg_save_system_cache(string $type, $data, int $expire_after=null)
Elgg cache Cache file interface for caching data.
Definition: cache.php:16
elgg_load_system_cache(string $type)
Retrieve the contents of a system cache.
Definition: cache.php:27
_elgg_services()
Get the global service provider.
Definition: elgglib.php:353
elgg_register_simplecache_view(string $view_name)
Registers a view to simple cache.
Definition: cache.php:59
elgg_get_simplecache_url(string $view)
Get the URL for the cached view.
Definition: cache.php:78
elgg_clear_caches()
Clear all the registered caches.
Definition: cache.php:103