Elgg  Version master
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 
88 function elgg_invalidate_caches(): void {
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 }
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
$type
Definition: delete.php:21
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
Definition: actions.php:73
if(! $entity instanceof \ElggUser) $data
Definition: attributes.php:13
elgg_purge_caches()
Purge all the registered caches.
Definition: cache.php:118
elgg_register_simplecache_view(string $view_name)
Registers a view to simple cache.
Definition: cache.php:59
elgg_clear_caches()
Clear all the registered caches.
Definition: cache.php:103
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_invalidate_caches()
Invalidate all the registered caches.
Definition: cache.php:88
elgg_get_simplecache_url(string $view)
Get the URL for the cached view.
Definition: cache.php:78
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