ConfigFile
class ConfigFile (View source)
Config file management class.
Stores its data in $_SESSION
Methods
No description
Sets names of config options which will be placed in config file even if they are set to their default values (use only full paths)
Returns flipped array set by setPersistKeys()
By default ConfigFile allows setting of all configuration keys, use this method to set up a filter on set() method
Sets path mapping for updating config in updateWithGlobalConfig() or reading by getConfig()} or {@link getConfigArray()
Resets configuration data
Sets configuration data (overrides old data)
Sets config value
Returns default config in a flattened array
Updates config with values read from given array (config will contain differences to defaults from {\PhpMyAdmin\Config\Settings}).
Returns config value or $default if it's not set
Returns default config value or $default it it's not set ie. it doesn't exist in {\PhpMyAdmin\Config\Settings} ($cfg).
Returns config value, if it's not set uses the default one; returns $default if the path isn't set and doesn't contain a default value
Returns canonical path
Returns config database entry for $path
Returns server count
Returns server list
Returns DSN of given server
Returns server name
Removes server
Returns configuration array (full, multidimensional format)
Returns configuration array (flat format)
Database with allowed values for configuration stored in the $cfg array, used by setup script and user preferences to generate forms.
Details
__construct(array|null $baseConfig = null)
No description
void
setPersistKeys(array $keys)
Sets names of config options which will be placed in config file even if they are set to their default values (use only full paths)
array
getPersistKeysMap()
Returns flipped array set by setPersistKeys()
void
setAllowedKeys(array|null $keys)
By default ConfigFile allows setting of all configuration keys, use this method to set up a filter on set() method
void
setCfgUpdateReadMapping(array $mapping)
Sets path mapping for updating config in updateWithGlobalConfig() or reading by getConfig()} or {@link getConfigArray()
void
resetConfigData()
Resets configuration data
void
setConfigData(array $cfg)
Sets configuration data (overrides old data)
void
set(string $path, mixed $value, string|null $canonicalPath = null)
Sets config value
array
getFlatDefaultConfig()
Returns default config in a flattened array
void
updateWithGlobalConfig(array $cfg)
Updates config with values read from given array (config will contain differences to defaults from {\PhpMyAdmin\Config\Settings}).
mixed
get(string $path, mixed $default = null)
Returns config value or $default if it's not set
mixed
getDefault(string $canonicalPath, mixed $default = null)
Returns default config value or $default it it's not set ie. it doesn't exist in {\PhpMyAdmin\Config\Settings} ($cfg).
mixed
getValue(string $path, mixed $default = null)
Returns config value, if it's not set uses the default one; returns $default if the path isn't set and doesn't contain a default value
string
getCanonicalPath(string $path)
Returns canonical path
mixed
getDbEntry(string $path, mixed $default = null)
Returns config database entry for $path
int
getServerCount()
Returns server count
array
getServers()
Returns server list
string
getServerDSN(int $server)
Returns DSN of given server
string
getServerName(int $id)
Returns server name
void
removeServer(int $server)
Removes server
array
getConfig()
Returns configuration array (full, multidimensional format)
array
getConfigArray()
Returns configuration array (flat format)
array
getAllowedValues()
Database with allowed values for configuration stored in the $cfg array, used by setup script and user preferences to generate forms.
Value meaning: array - select field, array contains allowed values string - type override