Elgg  Version 3.0
Namespaces | Functions | Variables
cache.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 elgg_get_system_cache ()
 Returns an object suitable for caching system information. More...
 
 elgg_reset_system_cache ()
 Reset the system cache by deleting the caches. More...
 
 elgg_save_system_cache ($type, $data)
 Saves a system cache. More...
 
 elgg_load_system_cache ($type)
 Retrieve the contents of a system cache. More...
 
 elgg_delete_system_cache ($type)
 Deletes the contents of a system cache. More...
 
 elgg_is_system_cache_enabled ()
 Is system cache enabled. More...
 
 elgg_enable_system_cache ()
 Enables the system disk cache. More...
 
 elgg_disable_system_cache ()
 Disables the system disk cache. More...
 
 elgg_register_simplecache_view ($view_name)
 Registers a view to simple cache. More...
 
 elgg_get_simplecache_url ($view, $subview= '')
 Get the URL for the cached view. More...
 
 elgg_is_simplecache_enabled ()
 Is simple cache enabled. More...
 
 elgg_enable_simplecache ()
 Enables the simple cache. More...
 
 elgg_disable_simplecache ()
 Disables the simple cache. More...
 
 _elgg_rmdir ($dir, $empty=false)
 Recursively deletes a directory, including all hidden files. More...
 
 elgg_invalidate_simplecache ()
 Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every valid viewtype. More...
 
 elgg_flush_caches ()
 Flush all the registered caches. More...
 
 _elgg_is_cache_symlinked ()
 Checks if /cache directory has been symlinked to views simplecache directory. More...
 
 _elgg_symlink_cache ()
 Symlinks /cache directory to views simplecache directory. More...
 
 _elgg_cache_init ()
 Initializes the simplecache lastcache variable and creates system cache files when appropriate. More...
 
 _elgg_disable_caches ()
 Disable all caches. More...
 
 _elgg_clear_caches ()
 Clear all caches. More...
 
 _elgg_reset_opcache ()
 Resets OPcache. More...
 
 _elgg_enable_caches ()
 Enable all caches. More...
 
 _elgg_rebuild_public_container ()
 Rebuild public service container. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_cache_init ( )

Initializes the simplecache lastcache variable and creates system cache files when appropriate.

Returns
void

Definition at line 307 of file cache.php.

_elgg_clear_caches ( )

Clear all caches.

Returns
void

Definition at line 333 of file cache.php.

_elgg_disable_caches ( )

Disable all caches.

Returns
void

Definition at line 317 of file cache.php.

_elgg_enable_caches ( )

Enable all caches.

Returns
void

Definition at line 364 of file cache.php.

_elgg_is_cache_symlinked ( )

Checks if /cache directory has been symlinked to views simplecache directory.

Returns
bool

Definition at line 247 of file cache.php.

_elgg_rebuild_public_container ( )

Rebuild public service container.

Returns
void

Definition at line 380 of file cache.php.

_elgg_reset_opcache ( )

Resets OPcache.

Returns
void

Definition at line 350 of file cache.php.

_elgg_rmdir (   $dir,
  $empty = false 
)

Recursively deletes a directory, including all hidden files.

TODO(ewinslow): Move to filesystem package

Parameters
string$dirThe directory
bool$emptyIf true, we just empty the directory
Returns
boolean Whether the dir was successfully deleted.

Definition at line 190 of file cache.php.

_elgg_symlink_cache ( )

Symlinks /cache directory to views simplecache directory.

Returns
bool

Definition at line 265 of file cache.php.

elgg_delete_system_cache (   $type)

Deletes the contents of a system cache.

Parameters
string$typeThe type of cache to delete
Returns
bool
Since
3.0

Definition at line 58 of file cache.php.

elgg_disable_simplecache ( )

Disables the simple cache.

Warning
Simplecache is also purged when disabled.
See also
elgg_register_simplecache_view()
Returns
void
Since
1.8.0

Definition at line 175 of file cache.php.

elgg_disable_system_cache ( )

Disables the system disk cache.

Uses the 'system_cache_enabled' config with a boolean value. Resets the system cache.

Returns
void

Definition at line 92 of file cache.php.

elgg_enable_simplecache ( )

Enables the simple cache.

See also
elgg_register_simplecache_view()
Returns
void
Since
1.8.0

Definition at line 162 of file cache.php.

elgg_enable_system_cache ( )

Enables the system disk cache.

Uses the 'system_cache_enabled' config with a boolean value. Resets the system cache.

Returns
void

Definition at line 80 of file cache.php.

elgg_flush_caches ( )

Flush all the registered caches.

Returns
void
Since
1.11

Definition at line 234 of file cache.php.

elgg_get_simplecache_url (   $view,
  $subview = '' 
)

Get the URL for the cached view.

Recommended usage is to just pass the entire view name as the first and only arg:

1 $blog_js = elgg_get_simplecache_url('elgg/blog/save_draft.js');
2 $favicon = elgg_get_simplecache_url('favicon.ico');

For backwards compatibility with older versions of Elgg, this function supports "js" or "css" as the first arg, with the rest of the view name as the second arg:

1 $blog_js = elgg_get_simplecache_url('js', 'elgg/blog/save_draft.js');

This automatically registers the view with Elgg's simplecache.

Parameters
string$viewThe full view name
string$subviewIf the first arg is "css" or "js", the rest of the view name
Returns
string
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 141 of file cache.php.

elgg_get_system_cache ( )

Returns an object suitable for caching system information.

Returns
ElggCache

Definition at line 15 of file cache.php.

elgg_invalidate_simplecache ( )

Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every valid viewtype.

Returns
bool
Since
1.7.4

Definition at line 224 of file cache.php.

elgg_is_simplecache_enabled ( )

Is simple cache enabled.

Returns
bool
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 151 of file cache.php.

elgg_is_system_cache_enabled ( )

Is system cache enabled.

Returns
bool
Since
2.2.0

Definition at line 68 of file cache.php.

elgg_load_system_cache (   $type)

Retrieve the contents of a system cache.

Parameters
string$typeThe type of cache to load
Returns
mixed null if key not found in cache

Definition at line 47 of file cache.php.

elgg_register_simplecache_view (   $view_name)

Registers a view to simple cache.

Simple cache is a caching mechanism that saves the output of a view and its extensions into a file.

Warning
Simple cached views must take no parameters and return the same content no matter who is logged in.
Parameters
string$view_nameView name
Returns
void
See also
elgg_get_simplecache_url()
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 113 of file cache.php.

elgg_reset_system_cache ( )

Reset the system cache by deleting the caches.

Returns
void

Definition at line 24 of file cache.php.

elgg_save_system_cache (   $type,
  $data 
)

Saves a system cache.

Parameters
string$typeThe type or identifier of the cache
mixed$dataThe data to be saved
Returns
bool

Definition at line 36 of file cache.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 401 of file cache.php.