Avatar of Victor Kimura
Victor Kimura
Flag for Canada asked on

PHP COM: How to find out what methods are available

Hi,

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 php.net site::

$ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
  $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
  $creport = $crapp->OpenReport($my_report, 1);
     
$creport->Database->Tables->
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 php.net 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");

Thanks,
Victor
PHPC#QuickBooks

Avatar of undefined
Last Comment
Victor Kimura

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Madeira

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Victor Kimura

ASKER
Yeah, I posted on their forum. I joined them. it's free. I just thought someone may know here.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23