NullBackend extends AbstractBackend implements PhpCapableBackendInterface, TaggableBackendInterface

A caching backend which forgets everything immediately

Table of Contents

Interfaces

PhpCapableBackendInterface
A contract for a cache backend which is capable of storing, retrieving and including PHP source code.
TaggableBackendInterface
A contract for a cache backend which supports tagging.

Constants

DATETIME_EXPIRYTIME_UNLIMITED  = '9999-12-31T23:59:59+0000'
UNLIMITED_LIFETIME  = 0

Properties

$cache  : FrontendInterface
Reference to the cache which uses this backend
$cacheIdentifier  : string
$context  : string
The current application context
$defaultLifetime  : int
Default lifetime of a cache entry in seconds

Methods

__construct()  : mixed
Constructs this backend
collectGarbage()  : mixed
Does nothing
findIdentifiersByTag()  : array<string|int, mixed>
Returns an empty array
flush()  : mixed
Does nothing
flushByTag()  : mixed
Does nothing
flushByTags()  : mixed
Backwards compatibility safeguard since re-introducing flushByTags as API.
get()  : bool
Returns False
has()  : bool
Returns False
remove()  : bool
Does nothing
require()  : bool
Does nothing
requireOnce()  : bool
Does nothing
set()  : mixed
Acts as if it would save data
setCache()  : mixed
Sets a reference to the cache frontend which uses this backend
setCompression()  : mixed
Acts as if it would enable data compression
setDefaultLifetime()  : mixed
Sets the default lifetime for this cache backend
calculateExpiryTime()  : DateTime
Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.

Constants

DATETIME_EXPIRYTIME_UNLIMITED

public mixed DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000'

UNLIMITED_LIFETIME

public mixed UNLIMITED_LIFETIME = 0

Properties

$cacheIdentifier

protected string $cacheIdentifier

$context

The current application context

protected string $context

This variable is currently unused and set to "production" always. It is only kept to keep backwards compatibility.

$defaultLifetime

Default lifetime of a cache entry in seconds

protected int $defaultLifetime = 3600

Methods

__construct()

Constructs this backend

public __construct(string $context[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$context : string

Unused, for backward compatibility only

$options : array<string|int, mixed> = []

Configuration options - depends on the actual backend

Tags
throws
InvalidArgumentException

collectGarbage()

Does nothing

public collectGarbage() : mixed

findIdentifiersByTag()

Returns an empty array

public findIdentifiersByTag(string $tag) : array<string|int, mixed>
Parameters
$tag : string

ignored

Return values
array<string|int, mixed>

An empty array

flush()

Does nothing

public flush() : mixed

flushByTag()

Does nothing

public flushByTag(string $tag) : mixed
Parameters
$tag : string

ignored

flushByTags()

Backwards compatibility safeguard since re-introducing flushByTags as API.

public flushByTags(array<string|int, string> $tags) : mixed

See https://review.typo3.org/#/c/50537/ comments for patch set 14.

The method is here even though it is only required for TaggableBackendInterface. We add it here to ensure third party cache backends do not fail but instead delegate to a less efficient linear flushing behavior.

Parameters
$tags : array<string|int, string>

get()

Returns False

public get(string $entryIdentifier) : bool
Parameters
$entryIdentifier : string

ignored

Return values
bool

FALSE

has()

Returns False

public has(string $entryIdentifier) : bool
Parameters
$entryIdentifier : string

ignored

Return values
bool

FALSE

remove()

Does nothing

public remove(string $entryIdentifier) : bool
Parameters
$entryIdentifier : string

ignored

Return values
bool

FALSE

require()

Does nothing

public require(string $identifier) : bool
Parameters
$identifier : string

An identifier which describes the cache entry to load

Return values
bool

requireOnce()

Does nothing

public requireOnce(string $identifier) : bool
Parameters
$identifier : string

An identifier which describes the cache entry to load

Return values
bool

set()

Acts as if it would save data

public set(string $entryIdentifier, string $data[, array<string|int, mixed> $tags = [] ][, int $lifetime = null ]) : mixed
Parameters
$entryIdentifier : string

ignored

$data : string

ignored

$tags : array<string|int, mixed> = []

ignored

$lifetime : int = null

ignored

setCompression()

Acts as if it would enable data compression

public setCompression(bool $compression) : mixed
Parameters
$compression : bool

ignored

setDefaultLifetime()

Sets the default lifetime for this cache backend

public setDefaultLifetime(int $defaultLifetime) : mixed
Parameters
$defaultLifetime : int

Default lifetime of this cache backend in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.

Tags
throws
InvalidArgumentException

calculateExpiryTime()

Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.

protected calculateExpiryTime([int $lifetime = null ]) : DateTime
Parameters
$lifetime : int = null

The lifetime in seconds

Return values
DateTime

The expiry time


        
On this page

Search results