Create and read DLL in php?

5

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.

    
asked by anonymous 29.04.2014 / 21:56

3 answers

7

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)

    
29.04.2014 / 22:08
1

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.

    
29.04.2014 / 22:03
1

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.

    
29.04.2014 / 22:29