Page
Class Page
Table of Contents
Methods
- __construct() : mixed
- Creates new cache manager instance.
- convertUriToPath() : string
- Converts request uri into path safe file with .html extension.
- createFromCacheKey() : mixed
- delete() : bool|int
- Deletes the cache
- deleteAll() : bool
- Deletes all cache data
- disableVoting() : mixed
- enableVoting() : mixed
- exists() : bool
- Returns true if the cache exists
- getCacheKey() : string
- Returns cache key
- getInstance() : Page
- Returns current instance of the Storage.
- getLastModified() : int|false
- Returns the time the cache was last modified
- getMd5() : string|false
- Returns hash of the cache
- getPrivateKey() : mixed
- getSize() : int|false
- Returns cache size
- getStaticHtmlStorage() : AbstractStorage|null
- Returns the instance of the StaticHtmlStorage
- getStorage() : AbstractStorage|null
- Returns File Storage or Memcached Storage
- isCacheable() : bool
- Returns true if we can cache current request
- isVotingEnabled() : mixed
- markNonCacheable() : void
- Marks current page as non cacheable.
- onBeforeEndBufferContent() : mixed
- read() : string
- Returns html content from the cache
- setCacheProvider() : mixed
- setUserPrivateKey() : mixed
- write() : bool
- Writes the content to the storage
Methods
__construct()
Creates new cache manager instance.
public
__construct([mixed $requestUri = null ][, mixed $host = null ][, mixed $privateKey = null ]) : mixed
Parameters
- $requestUri : mixed = null
- $host : mixed = null
- $privateKey : mixed = null
convertUriToPath()
Converts request uri into path safe file with .html extension.
public
static convertUriToPath(string $uri[, string $host = null ][, string $privateKey = null ]) : string
Returns empty string if fails.
Parameters
- $uri : string
-
Uri.
- $host : string = null
-
Host name.
- $privateKey : string = null
Return values
stringcreateFromCacheKey()
public
static createFromCacheKey(mixed $cacheKey) : mixed
Parameters
- $cacheKey : mixed
delete()
Deletes the cache
public
delete() : bool|int
Return values
bool|intdeleteAll()
Deletes all cache data
public
deleteAll() : bool
Return values
booldisableVoting()
public
disableVoting() : mixed
enableVoting()
public
enableVoting() : mixed
exists()
Returns true if the cache exists
public
exists() : bool
Return values
boolgetCacheKey()
Returns cache key
public
getCacheKey() : string
Return values
stringgetInstance()
Returns current instance of the Storage.
public
static getInstance() : Page
Return values
PagegetLastModified()
Returns the time the cache was last modified
public
getLastModified() : int|false
Return values
int|falsegetMd5()
Returns hash of the cache
public
getMd5() : string|false
Return values
string|falsegetPrivateKey()
public
static getPrivateKey() : mixed
getSize()
Returns cache size
public
getSize() : int|false
Return values
int|falsegetStaticHtmlStorage()
Returns the instance of the StaticHtmlStorage
public
static getStaticHtmlStorage(string $cacheKey) : AbstractStorage|null
Parameters
- $cacheKey : string
-
unique cache identifier
Return values
AbstractStorage|nullgetStorage()
Returns File Storage or Memcached Storage
public
getStorage() : AbstractStorage|null
Return values
AbstractStorage|nullisCacheable()
Returns true if we can cache current request
public
isCacheable() : bool
Return values
boolisVotingEnabled()
public
isVotingEnabled() : mixed
markNonCacheable()
Marks current page as non cacheable.
public
markNonCacheable() : void
onBeforeEndBufferContent()
public
onBeforeEndBufferContent() : mixed
read()
Returns html content from the cache
public
read() : string
Return values
stringsetCacheProvider()
public
setCacheProvider(CacheProvider $provider) : mixed
Parameters
- $provider : CacheProvider
setUserPrivateKey()
public
setUserPrivateKey() : mixed
write()
Writes the content to the storage
public
write(string $content, string $md5) : bool
Parameters
- $content : string
-
the string that is to be written
- $md5 : string
-
the content hash