PHP and COM (
Page 1 of 9 )
You've already seen how PHP can be used to interface with Java components and JavaBeans. But here's something you didn't know - PHP can (shock shock! horror horror!) even be used to interface with Microsoft COM objects on the Windows platform. Will this be a happy marriage? Read on to find out.You'll remember how, just a few weeks ago, I was playing around with PHP's Java
extension, using it to access Java classes and class methods through my PHP
scripts. At that time, I thought that PHP's Java extension was a powerful
demonstration of the way PHP could be integrated with other technologies. But
little did I know that that was just the tip of the iceberg...
You see,
in addition to the Java extension, PHP also comes with a very neat little
appendage in the form of a COM (that's Component Object Model) extension. A
reusable component-based architecture developed by Microsoft, COM makes it
possible to do all kinds of cool OO-type things on the Microsoft platform. It's
fairly mature, supports many different applications, and is in use on millions
of systems worldwide. And - as if that wasn't quite enough - you can now use it
with PHP to do all kinds of nifty things through your Web browser.
I'm
not going to get into the details of COM here, but will assume you know the
basics (in case you don't, there are reams and reams of information on the
subject at
http://www.microsoft.com/com/). I'll
also assume that you have a working PHP-compliant Web server (either Apache or
IIS will do), and know the basics of PHP. In case you don't, get yourself
organized, and then flip the page to get started.