Get the URL for the cached fileThis automatically registers the view with Elgg's simplecache.
$blog_js = elgg_get_simplecache_url('js', 'blog/save_draft'); elgg_register_js('elgg.blog', $blog_js); elgg_load_js('elgg.blog');
- Parameters
-
string | $type | The file type: css or js |
string | $view | The view name after css/ or js/ |
- Returns
- string
<?php
class SimpleCache {
private $CONFIG;
}
}
}
}
} else {
$lastcache = 0;
}
}
}
}
}
}
if (!isset($this->CONFIG->views->simplecache) || !is_array($this->CONFIG->views->simplecache)) {
return false;
}
_elgg_rmdir(
"{$this->CONFIG->dataroot}views_simplecache");
mkdir("{$this->CONFIG->dataroot}views_simplecache");
$time = time();
$this->CONFIG->lastcache = $time;
return true;
}
if (!defined('UPGRADING') && empty($this->CONFIG->lastcache)) {
$this->CONFIG->lastcache = (int)
_elgg_services()->datalist->get(
'simplecache_lastupdate');
}
}
}
elgg_invalidate_simplecache()
Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every...
elgg_is_simplecache_enabled()
Is simple cache enabled.
_elgg_rmdir($dir)
Recursively deletes a directory, including all hidden files.
_elgg_get_simplecache_root()
Get the base url for simple cache requests.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
enable()
Enables the simple cache.
init()
Set up $CONFIG appropriately on engine boot.
invalidate()
Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every...
registerView($view_name)
Registers a view to simple cache.
getRoot()
Get the base url for simple cache requests.
disable()
Disables the simple cache.
isEnabled()
Is simple cache enabled.
__construct()
Constructor.
elgg_get_viewtype()
Return the current view type.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.