PHP Класс Elgg\Cache\SimpleCache

С версии: 1.10.0
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Config $config, ViewsService $views ) Constructor
disable ( ) : void Disables the simple cache.
enable ( ) : void Enables the simple cache.
getRoot ( ) : string Get the base url for simple cache requests
getUrl ( string $view, string $subview = '' ) : string Get the URL for the cached view.
init ( ) : void Set up config appropriately on engine boot.
invalidate ( ) : boolean Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every valid viewtype.
isEnabled ( ) : boolean Is simple cache enabled
registerView ( string $view_name ) : void Registers a view to simple cache.

Приватные методы

Метод Описание
getPath ( ) : string Returns the path to where views are simplecached.

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Config $config, ViewsService $views )
$config Elgg\Config Elgg's global configuration
$views Elgg\ViewsService Elgg's views registry

disable() публичный Метод

Disables the simple cache.
См. также: elgg_register_simplecache_view()
public disable ( ) : void
Результат void

enable() публичный Метод

Enables the simple cache.
См. также: elgg_register_simplecache_view()
public enable ( ) : void
Результат void

getRoot() публичный Метод

Get the base url for simple cache requests
public getRoot ( ) : string
Результат string The simplecache root url for the current viewtype.

getUrl() публичный Метод

Recommended usage is to just pass the entire view name as the first and only arg: $blog_js = $simpleCache->getUrl('blog/save_draft.js'); $favicon = $simpleCache->getUrl('graphics/favicon.ico'); 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: $blog_js = $simpleCache->getUrl('js', 'blog/save_draft.js'); This automatically registers the view with Elgg's simplecache.
public getUrl ( string $view, string $subview = '' ) : string
$view string The full view name
$subview string If the first arg is "css" or "js", the rest of the view name
Результат string

init() публичный Метод

Set up config appropriately on engine boot.
public init ( ) : void
Результат void

invalidate() публичный Метод

Deletes all cached views in the simplecache and sets the lastcache and lastupdate time to 0 for every valid viewtype.
public invalidate ( ) : boolean
Результат boolean

isEnabled() публичный Метод

Is simple cache enabled
public isEnabled ( ) : boolean
Результат boolean

registerView() публичный Метод

Simple cache is a caching mechanism that saves the output of a view and its extensions into a file.
См. также: elgg_get_simplecache_url()
public registerView ( string $view_name ) : void
$view_name string View name
Результат void