Elgg
Version 6.0
|
Simple cache service. More...
Public Member Functions | |
__construct (protected Config $config, protected ViewsService $views) | |
Constructor. More... | |
getUrl (string $view) | |
Get the URL for the cached view. More... | |
getRoot () | |
Get the base url for simple cache requests. More... | |
registerCacheableView (string $view) | |
Register a view as cacheable. More... | |
isCacheableView (string $view) | |
Is the view cacheable. More... | |
getCacheableViews () | |
Returns the cacheable views. More... | |
isEnabled () | |
Is simple cache enabled. More... | |
enable () | |
Enables the simple cache. More... | |
disable () | |
Disables the simple cache. More... | |
clear () | |
Deletes all cached views in the simplecache. More... | |
purge () | |
Purge old/stale cache content. More... | |
cachedAssetExists (int $cache_time, string $viewtype, string $view) | |
Check if a asset exists in the cache. More... | |
getCachedAssetLocation (int $cache_time, string $viewtype, string $view) | |
Get the cache location of an existing cached asset. More... | |
cacheAsset (string $viewtype, string $view, string $contents) | |
Store an asset for caching. More... | |
Protected Member Functions | |
getPath () | |
Returns the path to where views are simplecached. More... | |
getCacheFilename (string $viewtype, string $view, int $cache_time=null) | |
Get the cache file location. More... | |
Protected Attributes | |
array | $simplecache_views = [] |
Simple cache service.
Definition at line 15 of file SimpleCache.php.
Elgg\Cache\SimpleCache::__construct | ( | protected Config | $config, |
protected ViewsService | $views | ||
) |
Constructor.
Config | $config | Elgg's global configuration |
ViewsService | $views | Views service |
Definition at line 30 of file SimpleCache.php.
Elgg\Cache\SimpleCache::cacheAsset | ( | string | $viewtype, |
string | $view, | ||
string | $contents | ||
) |
Store an asset for caching.
string | $viewtype | view type |
string | $view | view to cache |
string | $contents | view contents |
Definition at line 253 of file SimpleCache.php.
Elgg\Cache\SimpleCache::cachedAssetExists | ( | int | $cache_time, |
string | $viewtype, | ||
string | $view | ||
) |
Check if a asset exists in the cache.
int | $cache_time | time the asset was cached |
string | $viewtype | view type |
string | $view | cached view name |
Definition at line 220 of file SimpleCache.php.
Elgg\Cache\SimpleCache::clear | ( | ) |
Deletes all cached views in the simplecache.
Definition at line 178 of file SimpleCache.php.
Elgg\Cache\SimpleCache::disable | ( | ) |
Disables the simple cache.
Definition at line 154 of file SimpleCache.php.
Elgg\Cache\SimpleCache::enable | ( | ) |
Enables the simple cache.
Definition at line 144 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getCacheableViews | ( | ) |
Elgg\Cache\SimpleCache::getCachedAssetLocation | ( | int | $cache_time, |
string | $viewtype, | ||
string | $view | ||
) |
Get the cache location of an existing cached asset.
int | $cache_time | time the asset was cached |
string | $viewtype | view type |
string | $view | cached view name |
Definition at line 236 of file SimpleCache.php.
|
protected |
Get the cache file location.
string | $viewtype | view type |
string | $view | cached view |
int | $cache_time | (optional) cache time (default ->lastcache; |
Definition at line 278 of file SimpleCache.php.
|
protected |
Returns the path to where views are simplecached.
Definition at line 167 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getRoot | ( | ) |
Get the base url for simple cache requests.
Definition at line 61 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getUrl | ( | string | $view | ) |
Get the URL for the cached view.
This automatically registers the view with Elgg's simplecache.
string | $view | The full view name |
Definition at line 50 of file SimpleCache.php.
Elgg\Cache\SimpleCache::isCacheableView | ( | string | $view | ) |
Is the view cacheable.
string | $view | the view name |
Definition at line 90 of file SimpleCache.php.
Elgg\Cache\SimpleCache::isEnabled | ( | ) |
Elgg\Cache\SimpleCache::purge | ( | ) |
Elgg\Cache\SimpleCache::registerCacheableView | ( | string | $view | ) |
Register a view as cacheable.
string | $view | the view name |
Definition at line 79 of file SimpleCache.php.
|
protected |
Definition at line 22 of file SimpleCache.php.