Elgg  Version master
Functions
cache.php File Reference

Go to the source code of this file.

Functions

 elgg_save_system_cache (string $type, $data, int $expire_after=null)
 Elgg cache Cache file interface for caching data. More...
 
 elgg_load_system_cache (string $type)
 Retrieve the contents of a system cache. More...
 
 elgg_delete_system_cache (string $type)
 Deletes the contents of a system cache. More...
 
 elgg_register_simplecache_view (string $view_name)
 Registers a view to simple cache. More...
 
 elgg_get_simplecache_url (string $view)
 Get the URL for the cached view. More...
 
 elgg_invalidate_caches ()
 Invalidate all the registered caches. More...
 
 elgg_clear_caches ()
 Clear all the registered caches. More...
 
 elgg_purge_caches ()
 Purge all the registered caches. More...
 

Function Documentation

elgg_clear_caches ( )

Clear all the registered caches.

Returns
void
Since
3.3

Definition at line 103 of file cache.php.

elgg_delete_system_cache ( string  $type)

Deletes the contents of a system cache.

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

Definition at line 38 of file cache.php.

elgg_get_simplecache_url ( string  $view)

Get the URL for the cached view.

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

This automatically registers the view with Elgg's simplecache.

Parameters
string$viewThe full view name
Returns
string
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 78 of file cache.php.

elgg_invalidate_caches ( )

Invalidate all the registered caches.

Returns
void
Since
3.3

Definition at line 88 of file cache.php.

elgg_load_system_cache ( string  $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 27 of file cache.php.

elgg_purge_caches ( )

Purge all the registered caches.

This will remove all old/stale items from the caches

Returns
void
Since
3.3

Definition at line 118 of file cache.php.

elgg_register_simplecache_view ( string  $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

Definition at line 59 of file cache.php.

elgg_save_system_cache ( string  $type,
  $data,
int  $expire_after = null 
)

Elgg cache Cache file interface for caching data.

Saves a system cache.

Parameters
string$typeThe type or identifier of the cache
mixed$dataThe data to be saved
int$expire_afterNumber of seconds to expire the cache after
Returns
bool

Definition at line 16 of file cache.php.