Base class for cache/data rebuilders.

package XenForo_CacheRebuilder

 Methods

Constructor.

__construct($keyName) 

Parameters

$keyName

string$keyName

Gets the specified cache rebuilder.

getCacheRebuilder(string $keyName) : \XenForo_CacheRebuilder_Abstract

Parameters

$keyName

string

Returns

Gets the key name.

getKeyName() : string

Returns

string

Gets a message about the type of content being rebuilt.

getRebuildMessage() : string | \XenForo_Phrase

Likely depends on phrases existing.

Returns

Gets a controller response that reroutes to start rebuilding the caches.

getRebuilderResponse(\XenForo_ControllerAdmin_Abstract $controller, array $caches, string | null $redirect) : \XenForo_ControllerResponse_Reroute

Admin CP only.

Parameters

$caches

array

List of caches to build. Either array of strings, or array of pairs: [cache name, options]

$redirect

stringnull

URL to redirect to; null to use referrer

Returns

Rebuilds the data as requested.

rebuild(integer $position, array $options, string $detailedMessage) : integer | true

If there is a large amount of data, it should only be partially rebuilt in each invocation.

If true is returned, then the rebuild is done. Otherwise, an integer should be returned. This will be passed to the next call as the position.

Parameters

$position

integer

Position to start building from.

$options

array

List of options. Can be modified and updated value will be passed to next call.

$detailedMessage

string

A detailed message about the progress to return.

Returns

integertrue

 Properties

 

List of cache builders.

$builders : array

 

Key name used for this object.

$_keyName : string