Config¶
-
class
OC\
Config
¶ - This class is responsible for reading and writing config.php, the very basicconfiguration file of Nextcloud.
Source: lib/private/Config.php#46
Constants¶
-
ENV_PREFIX = NC_
Source: lib/private/Config.php#47
Properties¶
-
protected static property
OC\Config::$
cache
¶ Source: lib/private/Config.php#50 Type: array Associative array ($key => $value)
-
protected static property
OC\Config::$
envCache
¶ Source: lib/private/Config.php#52 Type: array
-
protected static property
OC\Config::$
configDir
¶ Source: lib/private/Config.php#54 Type: string
-
protected static property
OC\Config::$
configFilePath
¶ Source: lib/private/Config.php#56 Type: string
-
protected static property
OC\Config::$
configFileName
¶ Source: lib/private/Config.php#58 Type: string
Methods¶
-
public
OC\Config::
__construct
($configDir, $fileName=config.php)¶ Source: Parameters: - $configDir (string) Path to the config dir, needs to end with ‘/’
- $fileName (string) (Optional) Name of the config file. Defaults to config.php
-
public
OC\Config::
getKeys
()¶ - Lists all available config keysPlease note that it does not return the values.
Source: lib/private/Config.php#78 Returns: array an array of key names
-
public
OC\Config::
getValue
($key, $default=null)¶ - Returns a config valuegets its value from an `NC_` prefixed environment variableif it doesn’t exist from config.phpif this doesn’t exist either, it will return the given `$default`
Source: Parameters: - $key (string) key
- $default (mixed) = null default value
Returns: mixed the value or $default
-
public
OC\Config::
setValues
($configs)¶ - Sets and deletes values and writes the config.php
Source: Parameters: - $configs (array) Associative array with key => value pairs
If value is null, the config key will be deleted
-
public
OC\Config::
setValue
($key, $value)¶ - Sets the value and writes it to config.php if required
Source: Parameters: - $key (string) key
- $value (mixed) value
-
protected
OC\Config::
set
($key, $value)¶ - This function sets the value
Source: Parameters: - $key (string) key
- $value (mixed) value
Returns: bool True if the file needs to be updated, false otherwise
-
public
OC\Config::
deleteKey
($key)¶ - Removes a key from the config and removes it from config.php if required
Source: Parameters: - $key (string)
-
protected
OC\Config::
delete
($key)¶ - This function removes a key from the config
Source: Parameters: - $key (string)
Returns: bool True if the file needs to be updated, false otherwise