Nextcloud PHP API (master)

ICache

This interface defines method for accessing the file based user cache.

Tags
since
6.0.0

Table of Contents

Constants

DEFAULT_TTL  = 24 * 60 * 60

Methods

clear()  : bool
Clear the user cache of all entries starting with a prefix
get()  : mixed
Get a value from the user cache
hasKey()  : bool
Check if a value is set in the user cache
isAvailable()  : bool
Check if the cache implementation is available
remove()  : bool
Remove an item from the user cache
set()  : bool
Set a value in the user cache

Constants

DEFAULT_TTL

public mixed DEFAULT_TTL = 24 * 60 * 60
Tags
since
30.0.0

Methods

clear()

Clear the user cache of all entries starting with a prefix

public clear([string $prefix = '' ]) : bool
Parameters
$prefix : string = ''

(optional)

Tags
since
6.0.0
Return values
bool

get()

Get a value from the user cache

public get(string $key) : mixed
Parameters
$key : string
Tags
since
6.0.0

hasKey()

Check if a value is set in the user cache

public hasKey(string $key) : bool

Directly read from GET to prevent race conditions

Parameters
$key : string
Tags
since
6.0.0
Return values
bool

isAvailable()

Check if the cache implementation is available

public static isAvailable() : bool
Tags
since
24.0.0
Return values
bool

remove()

Remove an item from the user cache

public remove(string $key) : bool
Parameters
$key : string
Tags
since
6.0.0
Return values
bool

set()

Set a value in the user cache

public set(string $key, mixed $value[, int $ttl = 0 ]) : bool
Parameters
$key : string
$value : mixed
$ttl : int = 0

Time To Live in seconds. Defaults to 606024

Tags
since
6.0.0
Return values
bool

        
On this page

Search results