![]() |
Bearsampp 2025.8.29
|
Public Member Functions | |
__construct () | |
deleteValue ($key, $subkey, $entry) | |
exists ($key, $subkey, $entry=null) | |
getLatestError () | |
getValue ($key, $subkey, $entry=null) | |
setExpandStringValue ($key, $subkey, $entry, $value) | |
setStringValue ($key, $subkey, $entry, $value) |
Data Fields | |
const | APP_BINS_REG_ENTRY = 'BEARSAMPP_BINS' |
const | APP_PATH_REG_ENTRY = 'BEARSAMPP_PATH' |
const | END_PROCESS_STR = 'FINISHED!' |
const | ENV_KEY = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' |
const | HKEY_CLASSES_ROOT = 'HKCR' |
const | HKEY_CURRENT_USER = 'HKCU' |
const | HKEY_LOCAL_MACHINE = 'HKLM' |
const | HKEY_USERS = 'HKEY_USERS' |
const | PROCESSOR_REG_ENTRY = 'Identifier' |
const | PROCESSOR_REG_SUBKEY = 'HARDWARE\DESCRIPTION\System\CentralProcessor\0' |
const | REG_BINARY = 'REG_BINARY' |
const | REG_DWORD = 'REG_DWORD' |
const | REG_ERROR_ENTRY = 'REG_ERROR_ENTRY' |
const | REG_ERROR_SET = 'REG_ERROR_SET' |
const | REG_EXPAND_SZ = 'REG_EXPAND_SZ' |
const | REG_MULTI_SZ = 'REG_MULTI_SZ' |
const | REG_NO_ERROR = 'REG_NO_ERROR' |
const | REG_SZ = 'REG_SZ' |
const | SYSPATH_REG_ENTRY = 'Path' |
Private Member Functions | |
setValue ($key, $subkey, $entry, $value, $type) | |
writeLog ($log) |
Private Attributes | |
$latestError |
Class Registry
This class provides methods to interact with the Windows Registry using VBScript. It includes functionalities to check the existence of registry keys, get and set values, and delete registry entries. The class also logs operations and errors.
Definition at line 17 of file class.registry.php.
__construct | ( | ) |
Registry constructor. Initializes the Registry class and logs the initialization.
Definition at line 57 of file class.registry.php.
References Util\logInitClass().
deleteValue | ( | $key, | |
$subkey, | |||
$entry ) |
Deletes a registry entry.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | $entry | The entry name. |
Definition at line 213 of file class.registry.php.
References setValue(), and writeLog().
exists | ( | $key, | |
$subkey, | |||
$entry = null ) |
Checks if a registry key or entry exists.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | null | $entry | The entry name (optional). |
Definition at line 82 of file class.registry.php.
References $result, Vbs\exec(), Vbs\getResultFile(), and writeLog().
getLatestError | ( | ) |
Retrieves the latest error message.
Definition at line 311 of file class.registry.php.
References $latestError.
getValue | ( | $key, | |
$subkey, | |||
$entry = null ) |
Retrieves the value of a registry entry.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | null | $entry | The entry name (optional). |
Definition at line 139 of file class.registry.php.
References $bearsamppLang, $result, Lang\ERROR, Vbs\exec(), Vbs\getResultFile(), Util\startWith(), and writeLog().
setExpandStringValue | ( | $key, | |
$subkey, | |||
$entry, | |||
$value ) |
Sets an expanded string value in the registry.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | $entry | The entry name. |
string | $value | The value to set. |
Definition at line 200 of file class.registry.php.
References setValue().
setStringValue | ( | $key, | |
$subkey, | |||
$entry, | |||
$value ) |
Sets a string value in the registry.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | $entry | The entry name. |
string | $value | The value to set. |
Definition at line 186 of file class.registry.php.
References setValue().
|
private |
Sets a value in the registry.
string | $key | The root key (e.g., HKEY_LOCAL_MACHINE). |
string | $subkey | The subkey path. |
string | $entry | The entry name. |
string | null | $value | The value to set (optional). |
string | $type | The type of value to set (e.g., SetStringValue). |
Definition at line 229 of file class.registry.php.
References $bearsamppLang, $result, Lang\ERROR, Vbs\exec(), Vbs\getResultFile(), Batch\refreshEnvVars(), Lang\REGISTRY_SET_ERROR_TEXT, Util\startWith(), and writeLog().
Referenced by deleteValue(), setExpandStringValue(), and setStringValue().
|
private |
Writes a log entry.
string | $log | The log message to write. |
Definition at line 68 of file class.registry.php.
References $bearsamppRoot, and Util\logDebug().
Referenced by deleteValue(), exists(), getValue(), and setValue().
|
private |
Definition at line 51 of file class.registry.php.
Referenced by getLatestError().
const APP_BINS_REG_ENTRY = 'BEARSAMPP_BINS' |
Definition at line 39 of file class.registry.php.
Referenced by ActionStartup\checkBinsRegKey(), ActionStartup\checkSystemPathRegKey(), Util\getAppBinsRegKey(), ActionSwitchVersion\processWindow(), and Util\setAppBinsRegKey().
const APP_PATH_REG_ENTRY = 'BEARSAMPP_PATH' |
Definition at line 42 of file class.registry.php.
Referenced by ActionStartup\checkPathRegKey(), Util\getAppPathRegKey(), Batch\refreshEnvVars(), and Util\setAppPathRegKey().
const END_PROCESS_STR = 'FINISHED!' |
Definition at line 19 of file class.registry.php.
const ENV_KEY = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' |
Definition at line 36 of file class.registry.php.
Referenced by Util\getAppBinsRegKey(), Util\getAppPathRegKey(), Util\getSysPathRegKey(), Util\setAppBinsRegKey(), Util\setAppPathRegKey(), and Util\setSysPathRegKey().
const HKEY_CLASSES_ROOT = 'HKCR' |
Definition at line 21 of file class.registry.php.
const HKEY_CURRENT_USER = 'HKCU' |
Definition at line 22 of file class.registry.php.
const HKEY_LOCAL_MACHINE = 'HKLM' |
Definition at line 23 of file class.registry.php.
Referenced by ActionStartup\cleanOldBehaviors(), Util\getAppBinsRegKey(), Util\getAppPathRegKey(), Util\getProcessorRegKey(), Util\getSysPathRegKey(), Nssm\infos(), BinMailpit\rebuildConf(), BinMemcached\rebuildConf(), BinXlight\rebuildConf(), Util\setAppBinsRegKey(), Util\setAppPathRegKey(), and Util\setSysPathRegKey().
const HKEY_USERS = 'HKEY_USERS' |
Definition at line 24 of file class.registry.php.
const PROCESSOR_REG_ENTRY = 'Identifier' |
Definition at line 49 of file class.registry.php.
Referenced by Util\getProcessorRegKey().
const PROCESSOR_REG_SUBKEY = 'HARDWARE\DESCRIPTION\System\CentralProcessor\0' |
Definition at line 48 of file class.registry.php.
Referenced by Util\getProcessorRegKey().
const REG_BINARY = 'REG_BINARY' |
Definition at line 28 of file class.registry.php.
const REG_DWORD = 'REG_DWORD' |
Definition at line 29 of file class.registry.php.
const REG_ERROR_ENTRY = 'REG_ERROR_ENTRY' |
Definition at line 32 of file class.registry.php.
const REG_ERROR_SET = 'REG_ERROR_SET' |
Definition at line 33 of file class.registry.php.
const REG_EXPAND_SZ = 'REG_EXPAND_SZ' |
Definition at line 27 of file class.registry.php.
const REG_MULTI_SZ = 'REG_MULTI_SZ' |
Definition at line 30 of file class.registry.php.
const REG_NO_ERROR = 'REG_NO_ERROR' |
Definition at line 34 of file class.registry.php.
const REG_SZ = 'REG_SZ' |
Definition at line 26 of file class.registry.php.
const SYSPATH_REG_ENTRY = 'Path' |
Definition at line 45 of file class.registry.php.
Referenced by ActionStartup\checkSystemPathRegKey(), Util\getSysPathRegKey(), and Util\setSysPathRegKey().