Simple cache service.
More...
Simple cache service.
Definition at line 15 of file SimpleCache.php.
Elgg\Cache\SimpleCache::__construct |
( |
protected Config |
$config, |
|
|
protected ViewsService |
$views |
|
) |
| |
Elgg\Cache\SimpleCache::cacheAsset |
( |
string |
$viewtype, |
|
|
string |
$view, |
|
|
string |
$contents |
|
) |
| |
Store an asset for caching.
- Parameters
-
string | $viewtype | view type |
string | $view | view to cache |
string | $contents | view contents |
- Returns
- int
Definition at line 249 of file SimpleCache.php.
Elgg\Cache\SimpleCache::cachedAssetExists |
( |
int |
$cache_time, |
|
|
string |
$viewtype, |
|
|
string |
$view |
|
) |
| |
Check if a asset exists in the cache.
- Parameters
-
int | $cache_time | time the asset was cached |
string | $viewtype | view type |
string | $view | cached view name |
- Returns
- bool
- Since
- 4.1
Definition at line 216 of file SimpleCache.php.
Elgg\Cache\SimpleCache::clear |
( |
| ) |
|
Deletes all cached views in the simplecache.
- Returns
- void
- Since
- 3.3
Definition at line 174 of file SimpleCache.php.
Elgg\Cache\SimpleCache::createSymbolicLink |
( |
| ) |
|
Symlinks /cache directory to views simplecache directory.
- Returns
- bool
- Since
- 6.1
Definition at line 302 of file SimpleCache.php.
Elgg\Cache\SimpleCache::disable |
( |
| ) |
|
Elgg\Cache\SimpleCache::enable |
( |
| ) |
|
Elgg\Cache\SimpleCache::getCacheableViews |
( |
| ) |
|
Elgg\Cache\SimpleCache::getCachedAssetLocation |
( |
int |
$cache_time, |
|
|
string |
$viewtype, |
|
|
string |
$view |
|
) |
| |
Get the cache location of an existing cached asset.
- Parameters
-
int | $cache_time | time the asset was cached |
string | $viewtype | view type |
string | $view | cached view name |
- Returns
- string|null null if asset doesn't exist
- Since
- 4.1
Definition at line 232 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getCacheFilename |
( |
string |
$viewtype, |
|
|
string |
$view, |
|
|
int |
$cache_time = null |
|
) |
| |
|
protected |
Get the cache file location.
- Parameters
-
string | $viewtype | view type |
string | $view | cached view |
int | $cache_time | (optional) cache time (default ->lastcache; |
- Returns
- string
Definition at line 274 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getPath |
( |
| ) |
|
|
protected |
Returns the path to where views are simplecached.
- Returns
- string
Definition at line 163 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getRoot |
( |
| ) |
|
Get the base url for simple cache requests.
- Returns
- string The simplecache root url for the current viewtype
Definition at line 61 of file SimpleCache.php.
Elgg\Cache\SimpleCache::getUrl |
( |
string |
$view | ) |
|
Get the URL for the cached view.
$blog_js = $simpleCache->getUrl('blog/save_draft.js');
$favicon = $simpleCache->getUrl('graphics/favicon.ico');
This automatically registers the view with Elgg's simplecache.
- Parameters
-
string | $view | The full view name |
- Returns
- string
Definition at line 50 of file SimpleCache.php.
Elgg\Cache\SimpleCache::isCacheableView |
( |
string |
$view | ) |
|
Is the view cacheable.
- Parameters
-
- Returns
- bool
Definition at line 90 of file SimpleCache.php.
Elgg\Cache\SimpleCache::isEnabled |
( |
| ) |
|
Elgg\Cache\SimpleCache::isSymbolicLinked |
( |
| ) |
|
Checks if /cache directory has been symlinked to views simplecache directory.
- Returns
- bool
- Since
- 6.1
Definition at line 289 of file SimpleCache.php.
Elgg\Cache\SimpleCache::purge |
( |
| ) |
|
Purge old/stale cache content.
- Returns
- void
Definition at line 183 of file SimpleCache.php.
Elgg\Cache\SimpleCache::registerCacheableView |
( |
string |
$view | ) |
|
Register a view as cacheable.
- Parameters
-
- Returns
- void
Definition at line 79 of file SimpleCache.php.
array Elgg\Cache\SimpleCache::$simplecache_views = [] |
|
protected |
The documentation for this class was generated from the following file: