Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

PHP COM: How to find out what methods are available


I'm just looking at the PHP COM class. I'm looking that the example code and it looks pretty powerful. I'm wondering how do I find out if I can open up, say, Quickbooks using the PHP COM and how do I open and what functions are available. It seems like the functions that will be available is different for each program.

So, for CrystalReports, the code is like. I obtained it from the site::

$ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
  $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
  $creport = $crapp->OpenReport($my_report, 1);
Item(1)->ConnectionProperties['User ID'] =  'blablabla'; 

Open in new window

How does one know that the COM object for CrystalReports11.ObjectFactory.1 has the functions CreateObject and OpenReport?

Specifically, I'd like to call Quickbooks. On the page it states:
Can be a ProgID, Class ID or Moniker that names the component to load. A ProgID is typically the application or DLL name, followed by a period, followed by the object name. e.g: Word.Application. A Class ID is the UUID that uniquely identifies a given class. A Moniker is a special form of naming, similar in concept to a URL scheme, that identifies a resource and specifies how it should be loaded. As an example, you could load up Word and get an object representing a word document by specifying the full path to the word document as the module name, or you can use LDAP: as a moniker to use the ADSI interface to LDAP.

How do I know the ProgID for Quickbooks and the object name following the period like:
$word = new COM("word.application") or die("Unable to instantiate Word");

Avatar of Scott Madeira
Scott Madeira
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura


Yeah, I posted on their forum. I joined them. it's free. I just thought someone may know here.