Elgg  Version 1.9
Namespaces | Functions
cache.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

Functions

 elgg_get_system_cache ()
 Returns an ElggCache 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_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 ($type, $view)
 
 _elgg_get_simplecache_root ()
 Get the base url for simple cache requests. More...
 
 _elgg_get_view_filetype ($view)
 Returns the type of output expected from the 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)
 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_load_cache ()
 Loads the system cache during engine boot. More...
 
 _elgg_cache_init ()
 Initializes the simplecache lastcache variable and creates system cache files when appropriate. More...
 

Function Documentation

_elgg_cache_init ( )

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

private

Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 328 of file cache.php.

_elgg_get_simplecache_root ( )

Get the base url for simple cache requests.

Returns
string The simplecache root url for the current viewtype. private
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 172 of file cache.php.

_elgg_get_view_filetype (   $view)

Returns the type of output expected from the view.

css/* views always return "css" js/* views always return "js"

Otherwise, returns "unknown"

Parameters
string$viewThe view name
Returns
string private
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 200 of file cache.php.

_elgg_load_cache ( )

Loads the system cache during engine boot.

See also
elgg_reset_system_cache() private
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 301 of file cache.php.

_elgg_rmdir (   $dir)

Recursively deletes a directory, including all hidden files.

Parameters
string$dir
Returns
boolean Whether the dir was successfully deleted. private
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 257 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
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 240 of file cache.php.

elgg_disable_system_cache ( )

Disables the system disk cache.

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

Returns
void
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 108 of file cache.php.

elgg_enable_simplecache ( )

Enables the simple cache.

See also
elgg_register_simplecache_view()
Returns
void
Since
1.8.0
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 225 of file cache.php.

elgg_enable_system_cache ( )

Enables the system disk cache.

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

Returns
void
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 92 of file cache.php.

elgg_get_simplecache_url (   $type,
  $view 
)
elgg_get_system_cache ( )

Returns an ElggCache object suitable for caching system information.

Returns
ElggFileCache

A default filestore cache using the dataroot.

Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 20 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
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 278 of file cache.php.

elgg_is_simplecache_enabled ( )

Is simple cache enabled.

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

Definition at line 214 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
string
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 69 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. If the view is called by the engine/handlers/cache_handler.php file, the Elgg engine will not be loaded and the contents of the view will returned from 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/cache.php, and /root/Elgg/engine/lib/views.php.

Definition at line 136 of file cache.php.

elgg_reset_system_cache ( )

Reset the system cache by deleting the caches.

Returns
void
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 40 of file cache.php.

elgg_save_system_cache (   $type,
  $data 
)

Saves a system cache.

Parameters
string$typeThe type or identifier of the cache
string$dataThe data to be saved
Returns
bool
Examples:
/root/Elgg/engine/lib/cache.php.

Definition at line 52 of file cache.php.