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'));
__construct(Config $config, Datalist $datalist, Views $views)
Constructor.
Access to configuration values.
isEnabled()
Is simple cache enabled.
disable()
Disables the simple cache.
init()
Set up config appropriately on engine boot.
getRoot()
Get the base url for simple cache requests.
elgg_get_viewtype()
Return the current view type.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
invalidate()
Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every...
getUrl($view, $subview= '')
Get the URL for the cached view.
enable()
Enables the simple cache.
registerView($view_name)
Registers a view to simple cache.
_elgg_rmdir($dir, $empty=false)
Recursively deletes a directory, including all hidden files.
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use