26 static $FILE_PATH_CACHE;
28 if (!$FILE_PATH_CACHE) {
29 $FILE_PATH_CACHE =
new ElggFileCache($CONFIG->dataroot .
'system_cache/');
32 return $FILE_PATH_CACHE;
55 if ($CONFIG->system_cache_enabled) {
72 if ($CONFIG->system_cache_enabled) {
74 $cached_data = $cache->load(
$type);
96 $CONFIG->system_cache_enabled = 1;
112 $CONFIG->system_cache_enabled = 0;
201 if (preg_match(
'~(?:^|/)(css|js)(?:$|/)~',
$view,
$m)) {
258 $files = array_diff(scandir($dir), array(
'.',
'..'));
260 foreach (
$files as $file) {
261 if (is_dir(
"$dir/$file")) {
264 unlink(
"$dir/$file");
281 if (!isset($CONFIG->views->simplecache) || !is_array($CONFIG->views->simplecache)) {
285 _elgg_rmdir(
"{$CONFIG->dataroot}views_simplecache");
286 mkdir(
"{$CONFIG->dataroot}views_simplecache");
290 $CONFIG->lastcache = $time;
304 $CONFIG->system_cache_loaded =
false;
306 $CONFIG->views =
new stdClass();
308 if (!is_string(
$data)) {
311 $CONFIG->views->locations = unserialize(
$data);
314 if (!is_string(
$data)) {
317 $CONFIG->view_types = unserialize(
$data);
319 $CONFIG->system_cache_loaded =
true;
331 if (!defined(
'UPGRADING') && empty($CONFIG->lastcache)) {
332 $CONFIG->lastcache = (int)
datalist_get(
'simplecache_lastupdate');
336 if ($CONFIG->system_cache_enabled && !$CONFIG->system_cache_loaded) {
341 if ($CONFIG->system_cache_enabled && !$CONFIG->i18n_loaded_from_cache) {
343 foreach ($CONFIG->translations as
$lang => $map) {
elgg_enable_system_cache()
Enables the system disk cache.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_reset_system_cache()
Reset the system cache by deleting the caches.
_elgg_cache_init()
Initializes the simplecache lastcache variable and creates system cache files when appropriate...
elgg_invalidate_simplecache()
Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every...
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_disable_system_cache()
Disables the system disk cache.
elgg_get_system_cache()
Returns an ElggCache object suitable for caching system information.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
reload_all_translations()
Reload all translations from all registered paths.
_elgg_get_view_filetype($view)
Returns the type of output expected from the view.
elgg_get_viewtype()
Return the current view type.
elgg_get_simplecache_url($type, $view)
_elgg_load_cache()
Loads the system cache during engine boot.
datalist_get($name)
Get the value of a datalist element.
elgg_set_config($name, $value)
Set an Elgg configuration value.
datalist_set($name, $value)
Set the value for a datalist element.
elgg global
Pointer to the global context.
_elgg_get_simplecache_root()
Get the base url for simple cache requests.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
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_rmdir($dir)
Recursively deletes a directory, including all hidden files.
elgg_enable_simplecache()
Enables the simple cache.
elgg_get_data_path()
Get the data directory path for this installation.