Nextcloud PHP API (stable19)

ICache

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

Tags
since
6.0.0

Table of Contents

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
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
Return values
mixed

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

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) : bool
Parameters
$key : string
$value : mixed
$ttl : int

Time To Live in seconds. Defaults to 606024

Tags
since
6.0.0
Return values
bool

Search results