Elgg
Version 4.3
|
Simple cache service. More...
Public Member Functions | |
__construct (Config $config, ViewsService $views) | |
Constructor. More... | |
getUrl ($view, $subview= '') | |
Get the URL for the cached view. More... | |
getRoot () | |
Get the base url for simple cache requests. 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 | |
$config | |
$views | |
Simple cache service.
Definition at line 15 of file SimpleCache.php.
Elgg\Cache\SimpleCache::__construct | ( | Config | $config, |
ViewsService | $views | ||
) |
Constructor.
Config | $config | Elgg's global configuration |
ViewsService | $views | Views service |
Definition at line 33 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 226 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 193 of file SimpleCache.php.
Elgg\Cache\SimpleCache::clear | ( | ) |
Deletes all cached views in the simplecache.
Definition at line 149 of file SimpleCache.php.
Elgg\Cache\SimpleCache::disable | ( | ) |
Disables the simple cache.
Definition at line 126 of file SimpleCache.php.
Elgg\Cache\SimpleCache::enable | ( | ) |
Enables the simple cache.
Definition at line 116 of file SimpleCache.php.
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 209 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 251 of file SimpleCache.php.
|
protected |
Returns the path to where views are simplecached.
Definition at line 139 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getRoot | ( | ) |
Get the base url for simple cache requests.
Definition at line 90 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getUrl | ( | $view, | |
$subview = '' |
|||
) |
Get the URL for the cached view.
Recommended usage is to just pass the entire view name as the first and only arg:
For backwards compatibility with older versions of Elgg, you can also pass "js" or "css" as the first arg, with the rest of the view name as the second arg:
This automatically registers the view with Elgg's simplecache.
string | $view | The full view name |
string | $subview | If the first arg is "css" or "js", the rest of the view name |
Definition at line 65 of file SimpleCache.php.
Elgg\Cache\SimpleCache::isEnabled | ( | ) |
Elgg\Cache\SimpleCache::purge | ( | ) |
|
protected |
Definition at line 20 of file SimpleCache.php.
|
protected |
Definition at line 25 of file SimpleCache.php.