Recently, I had a client task that involved formatting a XML document according to a pre-defined set of rules. Sounds easy enough – write a PHP script that reads the source file, runs through the formatting rules and spits out the converted file. However, the requirement had a catch. The solution should be able to run on a desktop (PC) without an internet connection, and without Apache support. This takes us to the realm of desktop applications. There are languages like Visual Basic (DLL, COM etc.) but if you don’t want to deal with proprietary technologies, there is still an option, and better still, you can use PHP.
There is a utility called BAMBALAM (http://www.bambalam.se/bamcompile/) – this lets you create an executable file (.exe) from your PHP code that can be run directly on Windows or a Mac (in a simulated Windows environment). All you need to do is write your PHP script as you normally would, and use the BAMBALAM compiler to convert it into a Windows .exe file. That’s it. There’s also an option to compress the .exe file – it reduces the footprint on the disk. Expect the average executable file size to be around 500 Kb.
-Abhi
