config
in package
Manages Jeedom configuration system
Tags
Table of Contents
Properties
- $cache : array<string, mixed>
- $defaultConfiguration : array<string, array<string, array<string, mixed>>>
- $encryptKey : array<string|int, string>
- $nocache : array<string|int, string>
Methods
- byKey() : string|mixed
- Gets configuration value by key
- byKeys() : array<string, mixed>
- Gets multiple configuration values by keys
- checkValueBetween() : float|int|mixed
- Ensures value is between bounds
- genKey() : string
- Generates a random key
- getDefaultConfiguration() : array<string, array<string, mixed>>
- Gets default configuration for a plugin
- getGenericTypes() : array<string, array<string, mixed>>
- Gets generic types configuration
- getHistorizedCmdNum() : int
- Gets number of historized commands
- getLogLevelPlugin() : array<string, mixed>
- Gets log levels by plugin
- getPluginEnable() : array<string, mixed>
- Gets list of enabled plugins
- getTimelinedCmdNum() : int
- Gets number of timelined commands
- postConfig_market_allowDns() : void
- Handles DNS configuration changes
- postConfig_object_summary() : void
- Refreshes object summaries after configuration change
- postConfig_theme_end_day_hour() : void
- Updates day theme end hour
- postConfig_theme_start_day_hour() : void
- Updates day theme start hour
- preConfig_css_background_opacity() : float
- Validates background opacity value
- preConfig_css_border_radius() : float
- Validates border radius value
- preConfig_historyArchivePackage() : int
- Validates history archive package value
- preConfig_historyArchiveTime() : int
- Validates history archive time value
- preConfig_info_latitude() : string
- Formats latitude value
- preConfig_info_longitude() : string
- Formats longitude value
- preConfig_market_password() : string
- Ensures market password is hashed
- preConfig_name() : string
- Sanitizes name value
- preConfig_tts_engine() : string
- Updates TTS engine configuration
- preConfig_widget_margin() : int
- Validates widget margin value
- preConfig_widget_step_height() : int
- Validates widget height step value
- preConfig_widget_step_width() : int
- Validates widget width step value
- remove() : bool
- Removes a configuration key
- save() : bool
- Saves a configuration value
- searchKey() : array<string|int, array<string, mixed>>
- Searches configuration by key pattern
Properties
$cache
private
static array<string, mixed>
$cache
= array()
Configuration cache
$defaultConfiguration
private
static array<string, array<string, array<string, mixed>>>
$defaultConfiguration
= array()
Default configuration values
$encryptKey
private
static array<string|int, string>
$encryptKey
= array('apipro', 'apitts', 'apimarket', 'samba::backup::password', 'samba::backup::ip', 'samba::backup::username', 'ldap:password', 'ldap:host', 'ldap:username', 'dns::token', 'api')
List of configuration keys to encrypt
$nocache
private
static array<string|int, string>
$nocache
= array('enableScenario')
Configuration keys that should not be cached
Methods
byKey()
Gets configuration value by key
public
static byKey(string $_key[, string $_plugin = 'core' ][, mixed $_default = '' ][, bool $_forceFresh = false ]) : string|mixed
Parameters
- $_key : string
-
Configuration key
- $_plugin : string = 'core'
-
Plugin name
- $_default : mixed = ''
-
Default value
- $_forceFresh : bool = false
-
Force cache refresh
Return values
string|mixed —Configuration value
byKeys()
Gets multiple configuration values by keys
public
static byKeys(array<string|int, string>|mixed $_keys[, string $_plugin = 'core' ][, mixed $_default = '' ]) : array<string, mixed>
Parameters
- $_keys : array<string|int, string>|mixed
-
Configuration keys
- $_plugin : string = 'core'
-
Plugin name
- $_default : mixed = ''
-
Default value
Tags
Return values
array<string, mixed> —Configuration values
checkValueBetween()
Ensures value is between bounds
public
static checkValueBetween(int|float|mixed $_value[, int|float|null $_min = null ][, int|float|null $_max = null ]) : float|int|mixed
Parameters
- $_value : int|float|mixed
-
Value to check
- $_min : int|float|null = null
-
Minimum bound
- $_max : int|float|null = null
-
Maximum bound
Return values
float|int|mixed —Checked value
genKey()
Generates a random key
public
static genKey([int $_car = 64 ]) : string
Parameters
- $_car : int = 64
-
Key length
Tags
Return values
string —Generated key
getDefaultConfiguration()
Gets default configuration for a plugin
public
static getDefaultConfiguration([string $_plugin = 'core' ]) : array<string, array<string, mixed>>
Parameters
- $_plugin : string = 'core'
-
Plugin name
Return values
array<string, array<string, mixed>> —Default configuration
getGenericTypes()
Gets generic types configuration
public
static getGenericTypes([bool $_coreOnly = false ]) : array<string, array<string, mixed>>
Parameters
- $_coreOnly : bool = false
-
Get only core types
Return values
array<string, array<string, mixed>> —Generic types
getHistorizedCmdNum()
Gets number of historized commands
public
static getHistorizedCmdNum() : int
Tags
Return values
int —Number of commands
getLogLevelPlugin()
Gets log levels by plugin
public
static getLogLevelPlugin() : array<string, mixed>
Tags
Return values
array<string, mixed> —Log levels
getPluginEnable()
Gets list of enabled plugins
public
static getPluginEnable() : array<string, mixed>
Tags
Return values
array<string, mixed> —Enabled plugins
getTimelinedCmdNum()
Gets number of timelined commands
public
static getTimelinedCmdNum() : int
Tags
Return values
int —Number of commands
postConfig_market_allowDns()
Handles DNS configuration changes
public
static postConfig_market_allowDns(int $_value) : void
Parameters
- $_value : int
-
New DNS allow status (0|1)
Tags
postConfig_object_summary()
Refreshes object summaries after configuration change
public
static postConfig_object_summary(mixed $_value) : void
Parameters
- $_value : mixed
-
Not used
postConfig_theme_end_day_hour()
Updates day theme end hour
public
static postConfig_theme_end_day_hour(string $_value) : void
Parameters
- $_value : string
-
Hour in format HH:mm
postConfig_theme_start_day_hour()
Updates day theme start hour
public
static postConfig_theme_start_day_hour(string $_value) : void
Parameters
- $_value : string
-
Hour in format HH:mm
preConfig_css_background_opacity()
Validates background opacity value
public
static preConfig_css_background_opacity(float $_value) : float
Parameters
- $_value : float
-
Opacity value
Return values
float —Validated value (between 0 and 1)
preConfig_css_border_radius()
Validates border radius value
public
static preConfig_css_border_radius(float $_value) : float
Parameters
- $_value : float
-
Border radius value
Return values
float —Validated value (between 0 and 1)
preConfig_historyArchivePackage()
Validates history archive package value
public
static preConfig_historyArchivePackage(int $_value) : int
Parameters
- $_value : int
-
Archive package count
Return values
int —Validated value (minimum 1)
preConfig_historyArchiveTime()
Validates history archive time value
public
static preConfig_historyArchiveTime(int $_value) : int
Parameters
- $_value : int
-
Archive time in days
Return values
int —Validated value (minimum 2)
preConfig_info_latitude()
Formats latitude value
public
static preConfig_info_latitude(string $_value) : string
Parameters
- $_value : string
-
Raw latitude
Return values
string —Formatted latitude (decimal format)
preConfig_info_longitude()
Formats longitude value
public
static preConfig_info_longitude(string $_value) : string
Parameters
- $_value : string
-
Raw longitude
Return values
string —Formatted longitude (decimal format)
preConfig_market_password()
Ensures market password is hashed
public
static preConfig_market_password(string $_value) : string
Parameters
- $_value : string
-
Password value
Return values
string —SHA1 hashed password
preConfig_name()
Sanitizes name value
public
static preConfig_name(string $_value) : string
Parameters
- $_value : string
-
Raw name
Return values
string —Sanitized name (removed special chars)
preConfig_tts_engine()
Updates TTS engine configuration
public
static preConfig_tts_engine(string $_value) : string
Parameters
- $_value : string
-
Engine identifier
Return values
string —Validated engine identifier
preConfig_widget_margin()
Validates widget margin value
public
static preConfig_widget_margin(int $_value) : int
Parameters
- $_value : int
-
Margin in pixels
Return values
int —Validated value (minimum 0)
preConfig_widget_step_height()
Validates widget height step value
public
static preConfig_widget_step_height(int $_value) : int
Parameters
- $_value : int
-
Height step in pixels
Return values
int —Validated value (minimum 1)
preConfig_widget_step_width()
Validates widget width step value
public
static preConfig_widget_step_width(int $_value) : int
Parameters
- $_value : int
-
Width step in pixels
Return values
int —Validated value (minimum 1)
remove()
Removes a configuration key
public
static remove(string $_key[, string $_plugin = 'core' ]) : bool
Parameters
- $_key : string
-
Configuration key
- $_plugin : string = 'core'
-
Plugin name
Return values
bool —Success status
save()
Saves a configuration value
public
static save(string $_key, mixed $_value[, string $_plugin = 'core' ]) : bool
Parameters
- $_key : string
-
Configuration key
- $_value : mixed
-
Configuration value
- $_plugin : string = 'core'
-
Plugin name
Return values
bool —Success status
searchKey()
Searches configuration by key pattern
public
static searchKey(string $_key[, string $_plugin = 'core' ]) : array<string|int, array<string, mixed>>
Parameters
- $_key : string
-
Key pattern to search
- $_plugin : string = 'core'
-
Plugin name
Tags
Return values
array<string|int, array<string, mixed>> —Matching configurations