Nextcloud PHP API (master)

ICache

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

Tags
since
6.0.0

Table of Contents

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

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
Parameters
$key : string
Tags
since
6.0.0
deprecated
9.1.0

Directly read from GET to prevent race conditions

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