Nextcloud PHP API (stable18)

IMemcache extends ICache

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

Tags
since
8.1.0

Table of Contents

add()  : bool
Set a value in the cache if it's not already stored
cad()  : bool
Compare and delete
cas()  : bool
Compare and set
clear()  : bool
Clear the user cache of all entries starting with a prefix
dec()  : int
Decrease a stored number
get()  : mixed
Get a value from the user cache
hasKey()  : bool
Check if a value is set in the user cache
inc()  : int
Increase a stored number
remove()  : bool
Remove an item from the user cache
set()  : bool
Set a value in the user cache

Methods

add()

Set a value in the cache if it's not already stored

public add(string $key, mixed $value, int $ttl) : bool
Parameters
$key : string
$value : mixed
$ttl : int

Time To Live in seconds. Defaults to 606024

Tags
since
8.1.0
Return values
bool

cad()

Compare and delete

public cad(string $key, mixed $old) : bool
Parameters
$key : string
$old : mixed
Tags
since
8.1.0
Return values
bool

cas()

Compare and set

public cas(string $key, mixed $old, mixed $new) : bool
Parameters
$key : string
$old : mixed
$new : mixed
Tags
since
8.1.0
Return values
bool

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

dec()

Decrease a stored number

public dec(string $key[, int $step = 1 ]) : int
Parameters
$key : string
$step : int = 1
Tags
since
8.1.0
Return values
int

| 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

inc()

Increase a stored number

public inc(string $key[, int $step = 1 ]) : int
Parameters
$key : string
$step : int = 1
Tags
since
8.1.0
Return values
int

| 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