Click to See Complete Forum and Search --> : accessing the registry
Does anyone know of a safe way to access the registry for reading or writting from a PHP Script?
Is it necessary to use an external program to do this?
Has anyone out there done this yet?
TIA,
Matthew Nuzum
That's a good question. From an NT/2000 perspective, there are different "hives" of the registry stored in seperate .DAT files in different locations across the filesystem. In addition, the registry is encrypted so that simply opening the .DAT file in, say, Notepad renders it unintelligible.
Win9x stores the registry in a single .DAT file, but has a similar encrytption.
Brett
Command line tools could probably be used along with exec(), but I don't know if any command line tools exist in Win32 distributions.
Has anyone seen or heard of tools that can be used in this fashion?
I see only one way. To write your own DLL extension to PHP which will use WinAPI functions to handle registers. You will need some knowledge about C programming, but handling WinAPI functions isn't difficult, you can find fine help at microsoft web,
knowledge about compiling common DLLs and DLLs as PHP extension (PHP DLL have to contain special function and special array of new function names).
You will also need C compiler (MS Visual C), Cygwin (see notes in "Compiling PHP under Win32" on php.net) and PHP source (necessary!)
GOOD LUCK!
(I'v not any experience in bulding PHP extensions, but I'v been semi-succesfull in porting PHP code from MS VisualC to free C compirer MinGW32 (based on GCC but very similar to MSVC).
you can export the registry with a : regedit -e filename
and import too, but i cannot remember the switch
There is a perl module "Registry.pm".
this module include the registry.dll file,
if we can write our program by registry.dll of perl, it will be easier.
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.