« Back to Product

Documentation

IPS_GetOptionEx

 array IPS_GetOptionEx (string $Option) 

Parameters

Option

Name of the option, e.g. "ThreadCount"

Returns

The following key => value pairs are included. The data type of the values (bool, int, float or string) matches the type of the option:

Index Type Description
Current mixed Value currently in effect, i.e. the value at the last start of IP-Symcon
Default mixed Default value of the option
Pending mixed Stored value that applies from the next start (matches IPS_GetOption)

Description

Warning

This function is intended for internal use only and may change or be removed at any time without notice.

The function returns the value currently in effect, the default value and the stored value of the special switch Option.

If an option is changed with IPS_SetOption, the new value is stored immediately and returned as Pending. Current keeps the value IP-Symcon was started with until the next restart. If Current and Pending differ, a restart is therefore required to apply the change. Without a change since the start, both values are equal.

If the option does not exist, the function fails with "Cannot find option ... node in settings". For options that are still present in the settings but are no longer used by the installed version, it fails with "Cannot find default value for this option".

Example

$option = IPS_GetOptionEx("ThreadCount");
print_r($option);

if ($option['Current'] !== $option['Pending']) {
    echo "The change only takes effect after a restart";
}

/* e.g. returns:
Array
(
    [Current] => 50
    [Default] => 50
    [Pending] => 100
)
The change only takes effect after a restart
*/
Any questions?