Skip to content

2007

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.

ZendCon 2007

It's been a long week, but, as is usual for ZendCon, it was worth it.

Short version:

If you're looking for the slides from my Best Practices for Sending Mail from PHP talk, they are available here.

Highlights: Microsoft announces their first PHP extension (for talking to SQL Server) and go-live for their FastCGI support, Terry Chay on Ogres, new Trading cards and a couple of really nice drinks courtesy of Christian Flickinger and Curt Zirzow. Oh, and Joel Spolsky on something that had nothing to do with PHP, but was good fun all the same.

Things I'd rather forget: the Yahoo disco with obnoxiously loud and crass comedian and crappy beverages--your choice of Bud or Bud Light (which ran out), mediocre (at best) lunch offerings.

Long version:

I got in on Sunday at around noon, and had 3 hours to kill before I could check into my room. That was mildly irritating, because it meant hanging around in a "well travelled" state--it would have been nice to have had a shower a little sooner. I met up with some familiar and some not so familiar faces in the sports bar, and later over dinner. I persuaded Sara to procure a 4-pack of Red Bull for me (BTW, if anyone from Red Bull is reading this and is considering people for sponsorship deals, I'm an extreme programmer :-), and we planned some finishing touches for our tutorial session.

The Extending PHP tutorial was the next day; one full day of internals hackery featuring Marcus, Sara and myself. Usually these sessions attract 20-30 people, of which maybe 2-5 people admit to having developed in C or written their own extension. This particular session had 40-50 people at the start and a good 30+ had done C or extension development. I forgot to ask how many of those people work for Yahoo, but I'm guessing that a significant portion did. The turnout and qualifications of the attendees made for a very good session; there were good questions at the right places.

The next day I went to Terry Chays talk on Ogres. He also mentioned that simplicity is the new complexity and how complex is the new simple. I wasn't quite sold on the analogy, which got confusing when he used the word simple on a later slide (did that really mean complex? ;-) It was an entertaining talk, and I think I got the gist of what he was trying to say, which, simplified (complexified!?), is something along the lines of: you can build elegantly complex systems from simple building blocks, and those systems will have a comparatively low complexity compared to over-engineered systems. You could also say KISS, and remember the Pareto principle.

Later that day I gave my Mail talk to approximately 50 people in the big room used for the keynotes, which had a camera at the back and some big bright spotlights shining on the podium to illuminate the speaker. If you've ever been on that side of the room before, you'll know that those lights make things difficult because you can't see anything but silhouettes beyond the second row, and that makes it quite hard to read the body language of your audience for cues such as sleeping, nodding off, laptop use and actually looking at you. Despite this, I think the session went quite well, with good questions being asked throughout.

I don't really remember exactly what I did on Wednesday, aside from work, but recall helping Elizabeth Marie Smith with a build issue, Joe Stagners session on PHP-and-Windows, Lauras best-practices talk and sitting in on a Silverlight un-conference session.

I was in a meeting all day Thursday, so I missed the conference sessions, and saying goodbye to the folks at the conference. I was up at 3:30am the next morning to make sure that I made it to the airport for my flight home, touching down later that evening, just in time for the sunset.

It was great to have some more "face time" with people that I don't see too often, or that I've been corresponding with over email. I've been working in a fixer/advisor capacity towards a couple of PHP related things over the last few months, and this was an excellent opportunity to follow up on those things.

A lot of hours were spent talking, and I greatly value the conversation and the company. It might sound like these conferences are a week-long party, but they're hard work because the intensity level is so high. A typical day has me up around 6-7am and down for breakfast in under an hour, and then the whole day is spent talking or listening to people talking up until around 2am. I am by nature a fairly quiet person, so I find these events especially taxing, but it's worth it.

So thanks to everyone that shared their time with me at the conference, and I hope to see you next time!

Getting ready for OSCON 2007

I'm excited for OSCON, so much so that I don't mind my 5am start tomorrow. I'm in good spirits; we reached a big milestone at work a week or so ago and I've had a couple of days vacation, so I'm feeling rested and receptive for what I think is the best OpenSource conference out there.

As I mentioned in an earlier post, I'll be co-hosting a tutorial on extending/embedding PHP with Marcus Boerger bright and early on the Monday. If you're planning on attending, I strongly recommend pre-caffeinating yourselves as it will be an intense 3 hours! You can also see me doing my usual PDO talk (when people stop asking me to give it, I'll stop giving it!) on the Thursday.

Aside from getting together with the usual crowd again, I'm hoping to make some new friends. I'm also looking forward to some fun social events around the conference, and particularly looking forward to visiting my favourite restaurant in the whole world (I'm not going to tell you what it is until after I've been thereā€”it's mine, all mine!).

After the conference I'm bouncing up to Seattle for a Sushi-and-Xbox-360-on-120-inch-screen party with friends and colleagues from OmniTI. And after that, I'm bouncing down to San Jose for a couple of days before red-eyeing it back to the office.

A busy schedule ahead, and just over a week away from home; I think it's going to be a good combination of fun, busy, tiring and restful all at the same time.

If you see me there, stop me and say hi!

Wez @ ZendCon 2007

I've been a little tardy in mentioning this, but I'll be at ZendCon this year.

I'm co-hosting a mega tutorial session on Extending PHP with Marcus Boerger and Sara Golemon (this time, we three really are all there!), and giving my talking on best mailing practices for PHP.

That's right, no PDO talk this time around; it will make a nice change for me (not that I don't like giving that talk, it's just that I've given it so many times over the last couple of years!).

I like ZendCon; it has a good balance between business and dev. If you can persuade your boss, or you are the boss, you could do worse than book yourself into the conference.

OSCON 2007

This year, join Marcus Boerger, Sara Golemon and myself in an intense 3 hour tutorial covering everything we can possibly fit in the slot on the topic of Extending/Embedding PHP. Just in case you didn't know it, the three of us form something of a power trio when it comes to PHP internals, so who better to give such a tutorial eh? Having given my share of talks on this topic in the past, I'm not joking when I say it isn't for the faint hearted; there's a lot of material and 3 hours is short (we wanted a longer slot, but we'll take what we're given). Oh yes, it kicks off at 8:30am on the first day. Make sure you are suitably caffeinated for the kick-off and throughout.

Later in the week, at the more respectable time of 1:45pm, I'll be giving my PDO talk again. I've been given a 45 minute slot again, which is a tad tight, so I'll do my best to avoid spilling over into the next talk.

OSCON is my favorite conference; there's a lot of diversity in the content and the people which makes an excellent melting pot for ideas. It's interesting and a lot of fun; the conference highlight of the year. I'm looking forward to it, and to perhaps seeing you there.

HOWTO: Set yourself up with an OpenID

This post is in response to this comment on my blog (because I have no idea who that is :-). Here's my suggestion on how to get the most out of your OpenID.

  1. Get yourself an identity provider.
    I recommend using a pre-existing service rather than setting up your own. You can use AOL, Verisign (PIP), MyOpenID and a whole host of others.
  2. Edit your preferred blog or home page to configure it for delegation.
  3. When you sign into web apps, use your URL, not the URL from your provider.

I'm currently using AOL as my preferred identity provider; I also have accounts with Verisign and MyOpenID. If you already have an AIM account, you can use AOL as your identity provider without having to explicitly sign up for another service (which means that you don't need to remember yet another password).

So, assuming that you're using AOL, the next thing to do is edit your home page or blog template and add a couple of lines to the <head>:

   <link rel="openid.server" 

      href="https://api.screenname.aol.com/auth/openidServer">

   <link rel="openid.delegate"

       href="http://openid.aol.com/wezfurlong">

If you're using Verisign PIP:

   <link rel="openid.server"

      href="https://pip.verisignlabs.com/server/" />

   <link rel="openid.delegate"

      href="http://wezfurlong.pip.verisignlabs.com/" />

   <meta http-equiv="X-XRDS-Location"

      content="http://pip.verisignlabs.com/user/wezfurlong/yadis" />

   <meta http-equiv="X-YADIS-Location"

      content="http://pip.verisignlabs.com/user/wezfurlong/yadis" />

And for MyOpenID:

   <link rel="openid.server"

        href="http://www.myopenid.com/server" />

   <link rel="openid.delegate"

        href="http://youraccount.myopenid.com/" />

   <meta http-equiv="X-XRDS-Location"

        content="http://www.myopenid.com/xrds?username=youraccount.myopenid.com" />

These fragments allow an OpenID consumer site (such as my blog) to discover your identity provider and your identity with that provider. They can then initiate authentication using those credentials but then retain your original URL as your identity. This is nice because your URL is more meaningful than the various identity endpoint URLs from the providers, and also nice because you can easily switch out to a different provider if it takes your fancy.

This delegation mechanism relies on the consumer being able to parse your web page to locate those elements. Sometimes you may not be able to control some of the content on your page, so it may not be successfully parsed. You can avoid that issue by explicitly sending X-XRDS-Location and X-YADIS-Location headers, either in your PHP script, or by some magic in your httpd.conf.

Another trick is to redirect to your yadis file if the client indicates that it is looking for it:

   RewriteCond %{HTTP_ACCEPT} application/xrds\\+xml

   RewriteCond %{HTTP_ACCEPT} !application/xrds\\+xml\\s*;\\s*q\\s*=\\s*0(\\.0{1,3})?\\s*(,|$)

   RewriteRule ^$ http://netevil.org/yadis.xrdf [R,L]

(I think I borrowed this from Sam Ruby, or maybe it was Simon Willison).

What's in the yadis file? You can read all about it on openidenabled.com. Here's mine:

<?xml version="1.0" encoding="UTF-8"?>

<xrds:XRDS

  xmlns:xrds="xri://$xrds"

  xmlns:openid="http://openid.net/xmlns/1.0"  

  xmlns="xri://$xrd*($v*2.0)">

  <XRD>

    <Service priority="5">

      <Type>http://openid.net/signon/1.1</Type>

      <URI>https://api.screenname.aol.com/auth/openidServer</URI>

      <openid:Delegate>http://openid.aol.com/wezfurlong</openid:Delegate>

    </Service>

    <Service priority="10">

      <Type>http://openid.net/signon/1.1</Type>

      <Type>http://openid.net/sreg/1.0</Type>

      <URI>https://pip.verisignlabs.com/server</URI>

      <openid:Delegate>http://wezfurlong.pip.verisignlabs.com/</openid:Delegate>

    </Service>

    <Service priority="20">

      <Type>http://openid.net/signon/1.0</Type>

      <Type>http://openid.net/sreg/1.0</Type>

      <URI>https://pip.verisignlabs.com/server</URI>

      <openid:Delegate>http://wezfurlong.pip.verisignlabs.com/</openid:Delegate>

    </Service>

  </XRD>

</xrds:XRDS>

This yadis file says that I prefer to use AOL (its priority value is lower than the others) and then VeriSign PIP, preferring OpenID version 1.1 over version 1.0.

If you're using only one provider, you can just use their yadis URI rather than setting up your own (that's what those http-equiv meta elements are doing in my examples above).

PHP Recap/Redux

I've been pretty damned busy of late (we're in the late stages with going gold for our next Message Systems product release), but have managed to be involved in a couple of things PHPish, although I haven't had much time to follow up and talk about them.

MIX

I was invited to be a panelist at Microsoft's MIX conference for a discussion on the traditional pain points of getting PHP to run in a Windows environment and interoperating with ASP apps, and how Microsoft have taken a number of steps to help make the experience nicer, by improving the developer experience with IIS, shipping FastCGI support and working with PHP core developers to identify and tune some hotspots in PHP. The panel was pretty well attended given that it was one of the last sessions of the conference. You can find a recording of this session online here.

At MIX, the hot news was mostly Silverlight. It really demos very nicely and really does seem like a Flash killer, particularly because the tools are very nicely done. The really nice thing about Silverlight from my perspective is not so much the eye candy (sweet as it may be), as the Dynamic Language Runtime (DLR). The DLR allows you to run a subset of "dot-net" on the client side (both Windows and Mac), including scripting languages like Ruby and Python. This allows for some interesting possibilities, from something as basic as being able to use the same languages on both the client and the server side (very compelling from a maintenance perspective), to being able to use multiple languages (and libraries written in those languages) and call between them in your client side app.

This stuff isn't really all that new (you've been able to do some of that with COM compatible scripting interfaces for years--there's also a PHPScript implementation for the brave), but what's exciting is that it is bundled up into a runtime that has eye candy and support for two common OS platforms. The trick is in the eye-candy; that feature will wow people and cause a more rapid adoption of Silverlight than if it was just the DLR on its own.

Speaking of the DLR, Andi Gutmans and myself made it to the excellent Just Glue IT! talk presented by Jim Hugunin and John Lam (I love that URL!), on Python and Ruby (and more) in the DLR on Silverlight. It was very informative as well as humorous and with some nice live demos. You might be wondering if we're interested in PHP running on the DLR. I would love to see it there, even if it was just a subset of the PHP that we know and love. Perhaps the Phalanger project might shift in that direction?

From an organizational point of view, MIX, the conference, was very well put together. Some nice touches included: a speaker room equipped with snacks (ranging from power/protein bars and fruit to chips and candy), soda (which is typically very difficult to find at a conference without having to walk out of the conference area and paying exorbitant prices. This is very important for me, as coffee is a migraine trigger.), and what really clinched it for me: red bull (including sugar free).

Another nice touch was a double-sided laminated name tag--those things have a habit of flipping around so that you can't read them and find out who you're talking to. There was also a "sandbox" for you to bail out from the conference and sit down and play with the new technologies (they provided a number of machines for that purpose) or just sit down and talk. Minus points for not having enough (any?) power strips in the sessions themselves though; it made it difficult to get some work done while absorbing a session.

php|tek

It felt like php|tek was the first true PHP conference I've done this year (and that might even be true--I didn't bother to look back and check), so I was looking forward to being there, and also to see a bit more of Chicago, although I was a little disappointed to find that the conference was set in the "airport town", just far enough away from the real city to make visiting it a hard prospect. Such is life.

I think the php|architect folks did a fine job considering that the hotel threw a few spanners (or wrenches for you American folks) into the works, pushing a number of people (myself included) out of the conference hotel proper and into its more plain cousin a block or two down the street. I particularly wanted to attend Jeff Moore's talk on maintainable code but there was no room--people literally fell out of the session when I opened the door to get in there.

It was good to catch up with people again (and slightly weird to meet people that I'd seen a couple of weeks earlier at MIX--it's a bit surreal to be jumping timezones and locations and still see the same people), and to meet some more PHPWomen face-to-face. We had fun in the PHP trivia competition, and some of us were roped in to doing a podcast which came out surprisingly coherent despite the amount of alcohol in the room (I suspect that's because it was largely consumed by one of the Facebook guys ;-)

As someone who's been doing these conferences for a few years now, it's interesting to see the increasing number of MacBook laptops in use. I didn't count everybody's laptop, but the areas I frequented during the conference appeared to have MacBooks in the majority.

One of these conferences, I'll make it to one of Joe Stagner's talks and be there for the whole thing--I've tried to make that happen for at least the last 4 that I've been to, but it hasn't managed to work out how I've planned it, so far.

Blog upgraded

I've had the code sitting around for months, but haven't had the time to push it to production until now.

This is the third generation of my blog and incorporates the data from its prior incarnations (including my original s9y based 'zlog). The new architecture uses PostgreSQL for the database, largely because I want to take advantage of its LISTEN/NOTIFY support.

Another change from the previous incarnation is that the authentication system is now OpenID based, which suits me a great deal because I'm too lazy to code user management just for my blog (previously, I used a pass-through to the PHP CVS repository for auth).

I've restructured my URLs and implemented some fairly neat URL rewriting rules to make sure that the old links continue to work, even those for zlog.thebrainroom.net. I'll blog about that in another entry.

I've also decided to completely do away with HTML form based admin and blogging, because I'm always really frustrated by the editing interface. Instead, I'm using Microsoft Word 2007 (running under Parallels on my Macbook Pro) to post entries using its blogging capability.

php|tek, here I come

I'll be heading out for Chicago in a little while to attend php|tek, where I'll be giving my "pdo" and "mail" (a.k.a: "not pdo") talks.

I should be getting in to the hotel sometime around 7:30pm local time.

I've been really busy recently, so I haven't yet had a chance to figure out which other sessions I'll attend, but I do know that I'm really looking forward to re-sync'ing with everybody.

We're recruiting again, and I'm looking for both C and PHP folks to join my team at OmniTI/MessageSystems, so if you're going to be there and are interested, please make a point of finding me--I'd love to hear from you.

See you there :)

Goodnight Star

We said goodnight to Star for the last time tonight.

She was 13 years old and had been suffering from liver cancer for the last few months. Star was daughter of Bronte and mother to Lily. Bronte is still going strong at 15 years old back in England, and Lily (6) is now our alpha dog.

I like to remember the clan Mac Bronte like this:

We will miss you Star.