CaptureCache
extends AbstractPattern
in package
Table of Contents
- $options : PatternOptions
- clearByGlob() : mixed
- Clear cached pages matching glob pattern
- get() : string|null
- Get from cache
- getFilename() : string
- Returns the generated file name.
- getOptions() : PatternOptions
- Get all pattern options
- has() : bool
- Checks if a cache with given id exists
- remove() : bool
- Remove from cache
- set() : mixed
- Write content to page identity
- setOptions() : AbstractPattern
- Set pattern options
- start() : void
- Start the cache
- createDirectoryStructure() : void
- Creates directory if not already done.
- detectPageId() : string
- Determine the page to save from the request
- pageId2Filename() : string
- Get filename for page id
- pageId2Path() : string
- Get path for page id
- putFileContent() : void
- Write content to a file
Properties
$options
protected
PatternOptions
$options
Methods
clearByGlob()
Clear cached pages matching glob pattern
public
clearByGlob([string $pattern = '**' ]) : mixed
Parameters
- $pattern : string = '**'
Tags
Return values
mixed —get()
Get from cache
public
get([null|string $pageId = null ]) : string|null
Parameters
- $pageId : null|string = null
Tags
Return values
string|null —getFilename()
Returns the generated file name.
public
getFilename([null|string $pageId = null ]) : string
Parameters
- $pageId : null|string = null
Return values
string —getOptions()
Get all pattern options
public
getOptions() : PatternOptions
Return values
PatternOptions —has()
Checks if a cache with given id exists
public
has([null|string $pageId = null ]) : bool
Parameters
- $pageId : null|string = null
Tags
Return values
bool —remove()
Remove from cache
public
remove([null|string $pageId = null ]) : bool
Parameters
- $pageId : null|string = null
Tags
Return values
bool —set()
Write content to page identity
public
set(string $content[, null|string $pageId = null ]) : mixed
Parameters
- $content : string
- $pageId : null|string = null
Tags
Return values
mixed —setOptions()
Set pattern options
public
setOptions(PatternOptions $options) : AbstractPattern
Parameters
- $options : PatternOptions
Tags
Return values
AbstractPattern —Provides a fluent interface
start()
Start the cache
public
start([string $pageId = null ]) : void
Parameters
- $pageId : string = null
-
Page identifier
Return values
void —createDirectoryStructure()
Creates directory if not already done.
protected
createDirectoryStructure(string $pathname) : void
Parameters
- $pathname : string
Tags
Return values
void —detectPageId()
Determine the page to save from the request
protected
detectPageId() : string
Tags
Return values
string —pageId2Filename()
Get filename for page id
protected
pageId2Filename(string $pageId) : string
Parameters
- $pageId : string
Return values
string —pageId2Path()
Get path for page id
protected
pageId2Path(string $pageId) : string
Parameters
- $pageId : string
Return values
string —putFileContent()
Write content to a file
protected
putFileContent(string $file, string $data) : void
Parameters
- $file : string
-
File complete path
- $data : string
-
Data to write