peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.37k stars 203 forks source link

Add support for COM (Windows) #834

Open Indigo744 opened 4 years ago

Indigo744 commented 4 years ago

COM extension is actually not supported.

What would be the steps needed to bring it to PeachPie?

Of course it would work only on Windows, so I guess it should be made in a specific project (something like Peachpie.Library.Com)?

jakubmisek commented 4 years ago

The steps would be to create a project similar to Peachpie.Library or Peachpie.Library.Graphics.

The core of the functionality is probably the php class COM, which would have magic methods __call, __get, etc. It's implementation would be using basically Type.GetTypeFromProgID( ... ) and Activator.CreateInstance :)