Page 1 of 1

PHP COM Functions

PostPosted: November 26th, 2013, 8:45 am
by Saeid.a
Hi,
I'm new to Phalanger and i'm trying to test all the functionalities that i need for my projects. But when i'm trying COM it says
Code: Select all
Call to undefined external function 'COM::com', extension 'php_com' (extension not found)
.
I've added bellow code to machine.config
Code: Select all
<add assembly="php_com.mng, Version=3.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="COM" />

and my code is :
Code: Select all
$obj = new COM ( 'winmgmts://localhost/root/CIMV2' );
     
$wmi_computersystem    =    $obj->ExecQuery("Select * from Win32_ComputerSystem");

Re: PHP COM Functions

PostPosted: November 26th, 2013, 9:18 am
by Jakub Misek
Hi,

I'm not sure, if the COM class is included in the bundled php_com.dll. Anyway since Phalanger provides .NET to PHP, it is recommended to use .NET/COM objects directly from PHP, e.g.:
Code: Select all
new System.Management.ManagementObjectSearcher("Select * from Win32_ComputerSystem")
and reference
Code: Select all
<add assembly='System.Management' />