Nextcloud PHP API (stable18)

IConfig

Access to all the configuration options ownCloud offers

Tags
since
6.0.0

Table of Contents

SENSITIVE_VALUE  = '***REMOVED SENSITIVE VALUE***'
deleteAllUserValues()  : mixed
Delete all user values
deleteAppFromAllUsers()  : mixed
Delete all user related values of one app
deleteAppValue()  : mixed
Delete an app wide defined value
deleteAppValues()  : mixed
Removes all keys in appconfig belonging to the app
deleteSystemValue()  : mixed
Delete a system wide defined value
deleteUserValue()  : mixed
Delete a user value
getAppKeys()  : string[]
Get all keys stored for an app
getAppValue()  : string
Looks up an app wide defined value
getFilteredSystemValue()  : mixed
Looks up a system wide defined value and filters out sensitive data
getSystemValue()  : mixed
Looks up a system wide defined value
getSystemValueBool()  : bool
Looks up a boolean system wide defined value
getSystemValueInt()  : int
Looks up an integer system wide defined value
getSystemValueString()  : string
Looks up a string system wide defined value
getUserKeys()  : string[]
Get the keys of all stored by an app for the user
getUsersForUserValue()  : array
Determines the users that have the given value set for a specific app-key-pair
getUserValue()  : string
Shortcut for getting a user defined value
getUserValueForUsers()  : array
Fetches a mapped list of userId -> value, for a specified app and key and a list of user IDs.
setAppValue()  : void
Writes a new app wide value
setSystemValue()  : mixed
Sets a new system wide value
setSystemValues()  : mixed
Sets and deletes system wide values
setUserValue()  : mixed
Set a user defined value

Constants

SENSITIVE_VALUE

public mixed SENSITIVE_VALUE = '***REMOVED SENSITIVE VALUE***'
Tags
since
8.2.0

Methods

deleteAllUserValues()

Delete all user values

public deleteAllUserValues(string $userId) : mixed
Parameters
$userId : string

the userId of the user that we want to remove all values from

Tags
since
8.0.0
Return values
mixed

deleteAppFromAllUsers()

Delete all user related values of one app

public deleteAppFromAllUsers(string $appName) : mixed
Parameters
$appName : string

the appName of the app that we want to remove all values from

Tags
since
8.0.0
Return values
mixed

deleteAppValue()

Delete an app wide defined value

public deleteAppValue(string $appName, string $key) : mixed
Parameters
$appName : string

the appName that we stored the value under

$key : string

the key of the value, under which it was saved

Tags
since
8.0.0
Return values
mixed

deleteAppValues()

Removes all keys in appconfig belonging to the app

public deleteAppValues(string $appName) : mixed
Parameters
$appName : string

the appName the configs are stored under

Tags
since
8.0.0
Return values
mixed

deleteSystemValue()

Delete a system wide defined value

public deleteSystemValue(string $key) : mixed
Parameters
$key : string

the key of the value, under which it was saved

Tags
since
8.0.0
Return values
mixed

deleteUserValue()

Delete a user value

public deleteUserValue(string $userId, string $appName, string $key) : mixed
Parameters
$userId : string

the userId of the user that we want to store the value under

$appName : string

the appName that we stored the value under

$key : string

the key under which the value is being stored

Tags
since
8.0.0
Return values
mixed

getAppKeys()

Get all keys stored for an app

public getAppKeys(string $appName) : string[]
Parameters
$appName : string

the appName that we stored the value under

Tags
since
8.0.0
Return values
string[]

the keys stored for the app

getAppValue()

Looks up an app wide defined value

public getAppValue(string $appName, string $key[, string $default = '' ]) : string
Parameters
$appName : string

the appName that we stored the value under

$key : string

the key of the value, under which it was saved

$default : string = ''

the default value to be returned if the value isn't set

Tags
since
6.0.0
  • parameter $default was added in 7.0.0
Return values
string

the saved value

getFilteredSystemValue()

Looks up a system wide defined value and filters out sensitive data

public getFilteredSystemValue(string $key[, mixed $default = '' ]) : mixed
Parameters
$key : string

the key of the value, under which it was saved

$default : mixed = ''

the default value to be returned if the value isn't set

Tags
since
8.2.0
Return values
mixed

the value or $default

getSystemValue()

Looks up a system wide defined value

public getSystemValue(string $key[, mixed $default = '' ]) : mixed
Parameters
$key : string

the key of the value, under which it was saved

$default : mixed = ''

the default value to be returned if the value isn't set

Tags
since
6.0.0
  • parameter $default was added in 7.0.0
Return values
mixed

the value or $default

getSystemValueBool()

Looks up a boolean system wide defined value

public getSystemValueBool(string $key[, bool $default = false ]) : bool
Parameters
$key : string

the key of the value, under which it was saved

$default : bool = false

the default value to be returned if the value isn't set

Tags
since
16.0.0
Return values
bool

the value or $default

getSystemValueInt()

Looks up an integer system wide defined value

public getSystemValueInt(string $key, int $default) : int
Parameters
$key : string

the key of the value, under which it was saved

$default : int

the default value to be returned if the value isn't set

Tags
since
16.0.0
Return values
int

the value or $default

getSystemValueString()

Looks up a string system wide defined value

public getSystemValueString(string $key[, string $default = '' ]) : string
Parameters
$key : string

the key of the value, under which it was saved

$default : string = ''

the default value to be returned if the value isn't set

Tags
since
16.0.0
Return values
string

the value or $default

getUserKeys()

Get the keys of all stored by an app for the user

public getUserKeys(string $userId, string $appName) : string[]
Parameters
$userId : string

the userId of the user that we want to store the value under

$appName : string

the appName that we stored the value under

Tags
since
8.0.0
Return values
string[]

getUsersForUserValue()

Determines the users that have the given value set for a specific app-key-pair

public getUsersForUserValue(string $appName, string $key, string $value) : array
Parameters
$appName : string

the app to get the user for

$key : string

the key to get the user for

$value : string

the value to get the user for

Tags
since
8.0.0
Return values
array

of user IDs

getUserValue()

Shortcut for getting a user defined value

public getUserValue(string $userId, string $appName, string $key[, mixed $default = '' ]) : string
Parameters
$userId : string

the userId of the user that we want to store the value under

$appName : string

the appName that we stored the value under

$key : string

the key under which the value is being stored

$default : mixed = ''

the default value to be returned if the value isn't set

Tags
since
6.0.0
  • parameter $default was added in 7.0.0
Return values
string

getUserValueForUsers()

Fetches a mapped list of userId -> value, for a specified app and key and a list of user IDs.

public getUserValueForUsers(string $appName, string $key, array $userIds) : array
Parameters
$appName : string

app to get the value for

$key : string

the key to get the value for

$userIds : array

the user IDs to fetch the values for

Tags
since
8.0.0
Return values
array

Mapped values: userId => value

setAppValue()

Writes a new app wide value

public setAppValue(string $appName, string|float|int $key, string $value) : void
Parameters
$appName : string

the appName that we want to store the value under

$key : string|float|int

the key of the value, under which will be saved

$value : string

the value that should be stored

Tags
since
6.0.0

setSystemValue()

Sets a new system wide value

public setSystemValue(string $key, mixed $value) : mixed
Parameters
$key : string

the key of the value, under which will be saved

$value : mixed

the value that should be stored

Tags
since
8.0.0
Return values
mixed

setSystemValues()

Sets and deletes system wide values

public setSystemValues(array $configs) : mixed
Parameters
$configs : array

Associative array with key => value pairs If value is null, the config key will be deleted

Tags
since
8.0.0
Return values
mixed

setUserValue()

Set a user defined value

public setUserValue(string $userId, string $appName, string $key, string $value[, string $preCondition = null ]) : mixed
Parameters
$userId : string

the userId of the user that we want to store the value under

$appName : string

the appName that we want to store the value under

$key : string

the key under which the value is being stored

$value : string

the value that you want to store

$preCondition : string = null

only update if the config value was previously the value passed as $preCondition

Tags
throws
PreConditionNotMetException

if a precondition is specified and is not met

throws
UnexpectedValueException

when trying to store an unexpected value

since
6.0.0
  • parameter $precondition was added in 8.0.0
Return values
mixed

Search results