CacheLoader

CacheLoader

class CacheLoader extends Loader

CacheLoader is a loader that caches other loaders responses on the filesystem.

This cache only caches on disk to allow PHP accelerators to cache the opcodes. All other mechanism would imply the use of eval().

Methods

setLogger(LoggerInterface $logger)

Sets the debug logger to use for this loader.

from Loader
__construct(LoaderInterface $loader, string $dir)

Constructor.

Storage|bool load(TemplateReferenceInterface $template)

Loads a template.

bool isFresh(TemplateReferenceInterface $template, int $time)

Returns true if the template is still fresh.

Details

setLogger(LoggerInterface $logger)

Sets the debug logger to use for this loader.

Parameters

LoggerInterface $logger A logger instance

__construct(LoaderInterface $loader, string $dir)

Constructor.

Parameters

LoaderInterface $loader A Loader instance
string $dir The directory where to store the cache files

Storage|bool load(TemplateReferenceInterface $template)

Loads a template.

Parameters

TemplateReferenceInterface $template A template

Return Value

Storage|bool false if the template cannot be loaded, a Storage instance otherwise

bool isFresh(TemplateReferenceInterface $template, int $time)

Returns true if the template is still fresh.

Parameters

TemplateReferenceInterface $template A template
int $time The last modification time of the cached template (timestamp)

Return Value

bool

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/Templating/Loader/CacheLoader.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部