Zend Framework  3.0
Public Member Functions | Protected Member Functions | List of all members
CaptureCache Class Reference

Public Member Functions

 start ($pageId=null)
 Start the cache.
 
 set ($content, $pageId=null)
 Write content to page identity.
 
 get ($pageId=null)
 Get from cache.
 
 has ($pageId=null)
 Checks if a cache with given id exists.
 
 remove ($pageId=null)
 Remove from cache.
 
 clearByGlob ($pattern= '**')
 Clear cached pages matching glob pattern.
 
 getFilename ($pageId=null)
 Returns the generated file name.
 
- Public Member Functions inherited from AbstractPattern
 setOptions (PatternOptions $options)
 Set pattern options.
 
 getOptions ()
 Get all pattern options.
 

Protected Member Functions

 detectPageId ()
 Determine the page to save from the request.
 
 pageId2Filename ($pageId)
 Get filename for page id.
 
 pageId2Path ($pageId)
 Get path for page id.
 
 putFileContent ($file, $data)
 Write content to a file.
 
 createDirectoryStructure ($pathname)
 Creates directory if not already done.
 

Additional Inherited Members

- Protected Attributes inherited from AbstractPattern
 $options
 

Member Function Documentation

clearByGlob (   $pattern = '**')

Clear cached pages matching glob pattern.

Parameters
string$pattern
Exceptions
Exception\LogicException
createDirectoryStructure (   $pathname)
protected

Creates directory if not already done.

Parameters
string$pathname
Returns
void
Exceptions
Exception\RuntimeException
detectPageId ( )
protected

Determine the page to save from the request.

Exceptions
Exception\RuntimeException
Returns
string
get (   $pageId = null)

Get from cache.

Parameters
null | string$pageId
Returns
string|null
Exceptions
Exception\LogicException
Exception\RuntimeException
getFilename (   $pageId = null)

Returns the generated file name.

Parameters
null | string$pageId
Returns
string
has (   $pageId = null)

Checks if a cache with given id exists.

Parameters
null | string$pageId
Exceptions
Exception\LogicException
Returns
bool
pageId2Filename (   $pageId)
protected

Get filename for page id.

Parameters
string$pageId
Returns
string
pageId2Path (   $pageId)
protected

Get path for page id.

Parameters
string$pageId
Returns
string
putFileContent (   $file,
  $data 
)
protected

Write content to a file.

Parameters
string$fileFile complete path
string$dataData to write
Returns
void
Exceptions
Exception\RuntimeException
remove (   $pageId = null)

Remove from cache.

Parameters
null | string$pageId
Exceptions
Exception\LogicException
Exception\RuntimeException
Returns
bool
set (   $content,
  $pageId = null 
)

Write content to page identity.

Parameters
string$content
null | string$pageId
Exceptions
Exception\LogicException
start (   $pageId = null)

Start the cache.

Parameters
string$pageIdPage identifier
Returns
void