The built-in COM functionality of PHP4 is quite attractive for some of us programming in the win32 environment. So far, there is not much documentation on the subject. This short article will explain how to use COM in real PHP4 programming with three examples using MS office 2000 Word and Excel programs and the Adobe Distiller program. The COM technology has been developed by Microsoft for several years, under different names. As far as this article is concerned, the words OLE, OLE Automation, ActiveX and COM are all the same: They designate an encapsulated piece of code (the Object) that performs some functions for a windows application. PHP4 COM connects to the object (Instantiate the object) and uses its methods and properties.
Web developers who wish to use their time as efficiently as possible, should consider using an integrated development environment (IDE), if they are not already doing so. Just as the name suggests, a typical IDE provides the developer with an integrated suite of programming products, including an editor with multi-file editing, multiple undo and redo, local and global search and replace, stream and paragraph text selection, code-folding, multi-line tabbing, automatic creation and coloring of matching braces, intelligent indenting and outdenting of code, and more.
Trust is everything in this day and age. You have to trust a lot of people, from the guy who gives you directions to your local plumber. After all, you're not always the authority. However, when developing applications for the web, you must assume the role of authority. Otherwise, the user will assume the role, which is a big gamble: total data integrity, data corruption, or diversion of data -- if the user is the authority, you don't know what the results will be.
The Develop rock-solid code in PHP series is about solving practical real-life problems in medium- to large-scale applications. With a sharp focus on new features available in PHP 4, the articles shed light on numerous tips and tricks that make life easier. Inside, you will find plenty of examples and techniques to learn, with lots of sample code. In this first article, PHP veteran Amol Hatwar gives a higher perspective for designing and writing bug-free, maintainable code for medium- to large-scale Web applications.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.