Skip to content

Obj-C

PHP Objective-C Bridge

I've had some code hanging around on my laptop for the better part of a year (feels like two, but I don't think I've had my MBP that long), that implements a bridge between PHP and the Objective-C runtime. This is similar in spirit to CamelBones and PyObjC, but obviously a bit less mature.

Yesterday I debugged the last portion that I regarded as a total showstopper for anyone else that might want to use it, and added a script that pulls in your PHP installation and dependent libraries (such as Fink or Mac Ports libraries) and generates a "Bundle" and optionally a DMG containing the Bundle. I also persuaded Jan to try it out on Leopard, and discovered that Apple has deprecated most of the things I've been using for this (doh!) but we got it working on Leopard too. (note: you'll need to build your own PHP on Leopard, the one Apple ships has had its exports stripped, so you can't run the extension--it'll build, but not run)

There's still some way to go before I consider this "nice" to use, but it's a solid start. Jan built a simple GUI for the ping command:

I want to underscore that this is still in the very early stages, and that you'll most likely need a good bit of C and Objective-C savvy to get the most out of it right now, and that neither Jan nor myself can guarantee to fix problems that arise, but I in the spirit of release early, release often, I've put the code into the PHP CVS repository in the php-objc module, and created a php-objc mailing list on the PHP list server.

So, if you can figure out how to get at the code and on the mailing list, welcome! If you can't, it's too early for you to participate; you'll need to hold tight until we've made things easier to use.