Elgg  Version 1.11
Namespaces | Functions | Variables
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 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_cache_init ()
 Initializes the simplecache lastcache variable and creates system cache files when appropriate. 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.

private

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

Definition at line 230 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/classes/Elgg/Cache/SimpleCache.php, and /root/Elgg/engine/lib/cache.php.

Definition at line 128 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 148 of file cache.php.

_elgg_rmdir (   $dir)

Recursively deletes a directory, including all hidden files.

TODO(ewinslow): Move to filesystem package

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

Definition at line 199 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 186 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 74 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 173 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 62 of file cache.php.

elgg_get_simplecache_url (   $type,
  $view 
)
elgg_get_system_cache ( )

Returns an object suitable for caching system information.

Returns
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/classes/Elgg/Cache/SimpleCache.php, and /root/Elgg/engine/lib/cache.php.

Definition at line 220 of file cache.php.

elgg_is_simplecache_enabled ( )

Is simple cache enabled.

Returns
bool
Since
1.8.0
Examples:
/root/Elgg/engine/classes/Elgg/Cache/SimpleCache.php, and /root/Elgg/engine/lib/cache.php.

Definition at line 162 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 50 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/classes/Elgg/Cache/SimpleCache.php, /root/Elgg/engine/lib/cache.php, and /root/Elgg/engine/lib/views.php.

Definition at line 98 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 29 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 40 of file cache.php.

Variable Documentation

Definition at line 235 of file cache.php.