The php_registry Extension
In stand alone software it really useful to be able to edit
the system registry. An example would be to save configuration data.
The php_registry extension provides all the functionality required
to read and write to the system registry. This extension is available in 4 different versions named php4_registry.dll, php5_registry.dll, php51_registry.dll or php52_registry.dll (respectively for PHP
4, PHP 5, PHP 5.1 and PHP 5.2). These extensions provide the following constants and functions.
Defined constants are:
-
HKEY_CLASSES_ROOT
-
HKEY_CURRENT_USER
-
HKEY_LOCAL_MACHINE
-
HKEY_USERS
-
HKEY_PERFORMANCE_DATA
-
HKEY_CURRENT_CONFIG
-
HKEY_DYN_DATA
Defined functions are:
-
registry_create_key(RootKey: integer; Key: string): boolean; -
registry_delete_key(RootKey: integer; Key: string): boolean; -
registry_delete_entry(RootKey: integer; Key, Name: string): boolean; -
registry_has_subkeys(RootKey: integer; Key: string): boolean; -
registry_key_exists(RootKey: integer; Key: string): boolean; -
registry_read_float(RootKey: integer; Key, Name: string): double; -
registry_read_integer(RootKey: integer; Key, Name: string): integer; -
registry_read_boolean(RootKey: integer; Key, Name: string): boolean; -
registry_read_string(RootKey: integer; Key, Name: string): string; -
registry_write_float(RootKey: integer; Key, Name: string; Value: double): boolean; -
registry_write_integer(RootKey: integer; Key, Name: string; Value: integer): boolean; -
registry_write_boolean(RootKey: integer; Key, Name: string; Value: boolean): boolean; -
registry_write_string(RootKey: integer; Key, Name, Value: string): boolean;
The installation of this extension is similar to the one used
for installing other PHP extensions. Copy the appropriate file to
the extensions folder and then add the following line in the php.ini file. For example, for PHP 4, you would add:
extension=php4_registry.dll
For PHP 5, you would add:
extension=php5_registry.dll

