193 _elgg_services()->logger->warning(__FUNCTION__ .
' called with empty $dir');
200 $files = array_diff(scandir($dir), [
'.',
'..']);
203 if (is_dir(
"$dir/$file")) {
206 unlink(
"$dir/$file");
238 _elgg_services()->events->triggerSequence(
'cache:flush',
'system');
251 $symlink_path =
"{$root_path}cache";
253 if (!is_dir($simplecache_path)) {
256 return is_dir($symlink_path) && realpath($simplecache_path) == realpath($symlink_path);
274 $symlink_path =
"{$root_path}cache";
276 if (is_dir($symlink_path)) {
282 if (!is_dir($simplecache_path)) {
284 mkdir($simplecache_path, 0755,
true);
287 symlink($simplecache_path, $symlink_path);
293 if (is_dir($symlink_path)) {
294 unlink($symlink_path);
351 if (!function_exists(
'opcache_reset')) {
384 $dic_builder->useAnnotations(
false);
385 $dic_builder->setDefinitionCache($services->dic_cache);
387 $definitions = $services->dic_loader->getDefinitions();
388 foreach ($definitions as $definition) {
389 $dic_builder->addDefinitions($definition);
392 $dic = $dic_builder->build();
402 $events->registerHandler(
'ready',
'system',
'_elgg_cache_init');
404 $events->registerHandler(
'cache:flush:before',
'system',
'_elgg_disable_caches');
405 $events->registerHandler(
'cache:flush',
'system',
'_elgg_clear_caches');
406 $events->registerHandler(
'cache:flush',
'system',
'_elgg_reset_opcache');
407 $events->registerHandler(
'cache:flush:after',
'system',
'_elgg_enable_caches');
408 $events->registerHandler(
'cache:flush:after',
'system',
'_elgg_rebuild_public_container');
elgg_enable_system_cache()
Enables the system disk cache.
elgg_reset_system_cache()
Reset the system cache by deleting the caches.
_elgg_is_cache_symlinked()
Checks if /cache directory has been symlinked to views simplecache directory.
_elgg_cache_init()
Initializes the simplecache lastcache variable and creates system cache files when appropriate...
if(!array_key_exists($filename, $text_files)) $file
elgg_get_asset_path()
Get the asset cache directory path for this installation, ending with slash.
elgg_invalidate_simplecache()
Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every...
_elgg_symlink_cache()
Symlinks /cache directory to views simplecache directory.
_elgg_rebuild_public_container()
Rebuild public service container.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
_elgg_reset_opcache()
Resets OPcache.
elgg_disable_system_cache()
Disables the system disk cache.
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
elgg_get_system_cache()
Returns an object suitable for caching system information.
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
_elgg_disable_caches()
Disable all caches.
if(!$owner||!$owner->canEdit()) if(!$owner->hasIcon('master')) if(!$owner->saveIconFromElggFile($owner->getIcon('master'), 'icon', $coords)) $view
Base class for events and hooks.
elgg_get_root_path()
Get the project path (where composer is installed), ending with slash.
_elgg_clear_caches()
Clear all caches.
_elgg_rmdir($dir, $empty=false)
Recursively deletes a directory, including all hidden files.
elgg_delete_system_cache($type)
Deletes the contents of a system cache.
elgg_load_system_cache($type)
Retrieve the contents of a system cache.
elgg_is_simplecache_enabled()
Is simple cache enabled.
elgg_disable_simplecache()
Disables the simple cache.
elgg_save_system_cache($type, $data)
Saves a system cache.
elgg_is_system_cache_enabled()
Is system cache enabled.
_elgg_services()
Get the global service provider.
_elgg_enable_caches()
Enable all caches.
elgg_enable_simplecache()
Enables the simple cache.
foreach($resources as $id=> $href) if(!empty($resources_html)) $files
elgg_flush_caches()
Flush all the registered caches.