Would it be possible to create and open windows DLL libraries in php?
I want to organize my php classes in dll so that they can be used in both php and C #, if there is an alternative, it also works.
Would it be possible to create and open windows DLL libraries in php?
I want to organize my php classes in dll so that they can be used in both php and C #, if there is an alternative, it also works.
You can do this using the class COM .
But first, you have to register the dll in windows by running this command at the prompt:
REGSVR32 MinhaDll.dll
Now that the dll is registered, you do this to access the DLL:
$minha_dll = new COM(‘MinhaDll.Objeto’);
"my_dll" is the name of the dll and Object is the object inside the dll that you want to use. Now, for example, to call a method inside your dll that encrypts a text:
$texto_encriptado = null;
$input = ‘Texto que vai ser encriptado.’;
$minha_dll->EncriptaString($input, $texto_encriptado );
(assuming you have a method called EncryptString that accepts these parameter types)
Unable to open DLL files through an Apache / Unix server. Keep this in mind.
If you are using an IIS server, I think is reading may be helpful. You will have to use a COM server and use IDispatch, but it is not guaranteed to work.
Do not use this type of naming for PHP , it is not yet guaranteed that everything works out the way you expect, and the , require PHP For Windows and .Net Support and consequently server apache does not work.