35 $this->config = $config;
36 $this->datalist = $datalist;
37 $this->views = $views;
58 $view_name = $this->views->canonicalizeViewName($view_name);
88 if ((
$view ===
'js' ||
$view ===
'css') && 0 === strpos($subview,
$view .
'/')) {
94 if (!empty($subview)) {
95 $view =
"$view/$subview";
98 $view = $this->views->canonicalizeViewName(
$view);
115 $lastcache = (int)$this->config->get(
'lastcache');
129 return (
bool) $this->config->get(
'simplecache_enabled');
139 $this->datalist->set(
'simplecache_enabled', 1);
140 $this->config->set(
'simplecache_enabled', 1);
153 if ($this->config->get(
'simplecache_enabled')) {
154 $this->datalist->set(
'simplecache_enabled', 0);
155 $this->config->set(
'simplecache_enabled', 0);
166 private function getPath() {
167 $realpath = realpath($this->config->getCachePath());
168 return rtrim($realpath, DIRECTORY_SEPARATOR) .
"/views_simplecache";
181 $this->datalist->set(
"simplecache_lastupdate", $time);
182 $this->config->set(
'lastcache', $time);
193 $lastcache = $this->config->get(
'lastcache');
194 if (!defined(
'UPGRADING') && empty($lastcache)) {
195 $this->config->set(
'lastcache', (
int)$this->datalist->get(
'simplecache_lastupdate'));
_elgg_rmdir($dir, $empty=false)
Recursively deletes a directory, including all hidden files.
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.
getUrl($view, $subview='')
Get the URL for the cached view.
getRoot()
Get the base url for simple cache requests.
disable()
Disables the simple cache.
isEnabled()
Is simple cache enabled.
__construct(Config $config, Datalist $datalist, Views $views)
Constructor.
Access to configuration values.
elgg_get_viewtype()
Return the current view type.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.