AppConfig

class OC\AppConfig
This class provides an easy way for apps to store config values in the
database.
Source:lib/private/AppConfig.php#45
Implements:OCP\IAppConfig

Properties

protected static property OC\AppConfig::$sensitiveValues
Source:lib/private/AppConfig.php#48
Type:array[]
protected static property OC\AppConfig::$conn
Source:lib/private/AppConfig.php#72
Type:\OC\DB\Connection

Methods

public OC\AppConfig::__construct($conn)
Source:

lib/private/AppConfig.php#83

Parameters:
public OC\AppConfig::getApps()
Get all apps using the config
Source:

lib/private/AppConfig.php#109

Returns:

array an array of app ids

This function returns a list of all apps that have at least one entry in the appconfig table.

public OC\AppConfig::getKeys($app)
Get the available keys for an app
Source:

lib/private/AppConfig.php#124

Parameters:
  • $app (string) the app we are looking for
Returns:

array an array of key names

This function gets all keys of an app. Please note that the values are not returned.

public OC\AppConfig::getSortedKeys($data)
Source:lib/private/AppConfig.php#134
public OC\AppConfig::getValue($app, $key, $default=null)
Gets the config value
Source:

lib/private/AppConfig.php#151

Parameters:
  • $app (string) app
  • $key (string) key
  • $default (string) = null, default value if the key does not exist
Returns:

string the value or $default

This function gets a value from the appconfig table. If the key does not exist the default value will be returned

public OC\AppConfig::hasKey($app, $key)
check if a key is set in the appconfig
Source:

lib/private/AppConfig.php#168

Parameters:
  • $app (string)
  • $key (string)
Returns:

bool

public OC\AppConfig::setValue($app, $key, $value)
Sets a value. If the key did not exist before it will be created.
Source:

lib/private/AppConfig.php#182

Parameters:
  • $app (string) app
  • $key (string) key
  • $value (string | float | int) value
Returns:

bool True if the value was inserted or updated, false if the value was the same

public OC\AppConfig::deleteKey($app, $key)
Deletes a key
Source:

lib/private/AppConfig.php#250

Parameters:
  • $app (string) app
  • $key (string) key
Returns:

bool

public OC\AppConfig::deleteApp($app)
Remove app from appconfig
Source:

lib/private/AppConfig.php#273

Parameters:
  • $app (string) app
Returns:

bool Removes all keys in appconfig belonging to the app.

public OC\AppConfig::getValues($app, $key)
get multiple values, either the app or key can be used as wildcard by setting it to false
Source:

lib/private/AppConfig.php#293

Parameters:
  • $app (string | bool)
  • $key (string | bool)
Returns:

array | bool

public OC\AppConfig::getFilteredValues($app)
get all values of the app or and filters out sensitive data
Source:

lib/private/AppConfig.php#317

Parameters:
  • $app (string)
Returns:

array

protected OC\AppConfig::loadConfigValues()
Load all the app config values
Source:lib/private/AppConfig.php#335
public OC\AppConfig::clearCachedConfig()
Clear all the cached app config values
WARNING: do not use this - this is only for usage with the SCSSCacher to
clear the memory cache of the app config
Source:lib/private/AppConfig.php#367