Plugin cache class

access public
package kocuj_sitemap

 Methods

Action - clear cache for plugin which was activated or deactivated

actionClearCacheForPlugin(string $plugin, boolean $networkWide = false) : void
access public

Parameters

$plugin

string

Plugin name

$networkWide

boolean

Plugin is enabled or disabled for the entire network (true) or for site only (false) - default: false

Action - purge cache for deleting site

actionDeleteBlog(integer $siteId) : void
access public

Parameters

$siteId

integer

Site identifier

Action - recreate cache

actionRecreateCache() : void
access public

Check if cache directory is writable

checkWritable() : boolean
access public

Returns

booleanCache directory is writable (true) or not (false)

Clear cache

clearCache(integer $siteId = 0) : void
access public

Parameters

$siteId

integer

Site identifier; if it is set to 0, cache will be cleared for current site; this is ignored if it is not multisite installation - default: 0

Create cache

createCache() : void
access public

Filter - recreate cache

filterRecreateCache(array|boolean|float|integer|object|string $data) : array | boolean | float | integer | object | string
access public

Parameters

$data

arraybooleanfloatintegerobjectstring

Filter data

Returns

arraybooleanfloatintegerobjectstringFilter data

Get cache directory

getCacheDirectory(integer $siteId = 0) : string
access public

Parameters

$siteId

integer

Site identifier; if it is set to 0, cache directory will be get for current site; this is ignored if it is not multisite installation - default: 0

Returns

stringCache directory

Get cache root directory

getCacheRootDirectory() : string
access public

Returns

stringCache root directory

Get singleton instance

getInstance(array $actions = array(), array $filters = array()) : object
Static
access public

Parameters

$actions

array

Cache actions - default: empty

$filters

array

Cache filters - default: empty

Returns

objectSingleton instance

Load cache

loadCache() : string
access public

Returns

stringReturned buffer

Purge cache

purgeCache(integer $siteId = 0) : void
access public

Parameters

$siteId

integer

Site identifier; if it is set to 0, cache will be purged for all sites; this is ignored if it is not multisite installation - default: 0

Disable cloning of object

__clone() : void
access private

Constructor

__construct(array $actions = array(), array $filters = array()) : void
access private

Parameters

$actions

array

Cache actions - default: empty

$filters

array

Cache filters - default: empty

Add filters or actions for recreating cache

addRecreateCacheFiltersOrActions(array $data, boolean $isFilter) : void
access private

Parameters

$data

array

Filters or actions data

$isFilter

boolean

It is filter (true) or action (false)

Clear or purge cache

clearOrPurgeCache(boolean $purgeCache, integer $siteId = 0) : void
access private

Parameters

$purgeCache

boolean

Clear all cache files and directories (true) or clear cache files for current site only (false)

$siteId

integer

Site identifier; if it is set to 0, cache will be cleared for current site or purged for all sites; this is ignored if it is not multisite installation - default: 0

Get cache filename

getCacheFilename(string $locale) : string
access private

Parameters

$locale

string

Language locale

Returns

stringCache filename - if empty, there is an error in cache directory

 Properties

 

Cache content

$cacheContent : array

Default

array()
access private
 

Cache has been created now (true) or not (false)

$cacheCreated : boolean

Default

false
access private
 

Singleton instance

$instance : object

Default

NULL
Static
access private