Archive for the ‘PHP’ Category

I write quite a lot of command line utilities in PHP and luckily PDT makes it easy to debug command line scripts.

The thing with command line scripts is that often they require parameters passed on the command line, and PDT offers an easy way to pass them when you debug a script.

Assuming you already have debugging in Eclipse working (using either XDebug or Zend Debugger, both will work with this feature), here are the steps to debug a command line script using command line parameters:

  1. Right-click the script you want to debug and select 'Debug As...' and from the context menu that appears, select 'Debug Configurations...', like this:

    PDT context menu

  2. In the debug configurations screen that appears, select the 'PHP Script Arguements' tab. In the text box that appears, you can add fixed parameters (e.g. --key=value), but it's much more useful to use Eclipse's dynamic parameters, like this:

    picture-29

    In this case I entered --visitor=${string_prompt:Visitor} which means: pass --visitor= to the script when debugging, but ask me to enter a value named 'Visitor'.

  3. You can use the 'Variables' button to enter variables like this using a more visual wizard. There are many different prompts, string_prompt is just one example; you can prompt for folders and passwords as well, and you can inject certain system variables as a parameter using this wizard)
  4. After you've saved the Debug Configurations, again right-click the script you want to debug, and select 'Debug As...' and then 'PHP Script'.
  5. Eclipse now pops up the prompt, like this:

    picture-30

Voila, you can now debug your command line script by passing in dynamic parameters whenever you start the debug session.

P.S. This not only works in Eclipse PDT but also in Zend Studio for Eclipse and Aptana (in theory, haven't tried either yet).

P.P.S. No, I didn't create a script that allows me to track individual visitors, it's an archive processor for Flackr that uses the Visitor design pattern to make it easier to write multiple processors. I love Design Patterns.

It's about 2 months until the next Dutch PHP Conference in the Amsterdam RAI.

It's a step up from last year, with one additional conference day. The speaker lineup is awesome: people such as PHP core developer Scott MacVicar, Andrei 'Unicode' Zmievski, php|architect's Marco Tabini, Xdebug's Derick Rethans, Zend Framework architect Matthew Weier O'Phinney, security guru Stefan Esser, Restful Ben Ramsey, Paul 'KISS' Reinheimer and many, many others. See the full schedule here. It will all be hosted by our own Cal Evans.

I don't have to speak this year, I just get to do the closing keynote together with Cal and Marco. That'll be fun!

From all the DPC's I've visited before, this is the one I most look forward to. It's also nice to see industry adoption of the conference, with big names such as Microsoft and Oracle sponsoring the event. (Microsoft has xboxes and tickets to Las Vegas to give away, see their WinPHP Challenge.)

Oh, and if you order your tickets before April 30, there's a significant Early Bird discount. Register here.

Slides from 4Developers conference

March 10th, 2009 by Ivo

Last Saturday I was at the 4Developers Conference in Poland, as I mentioned before.

There weren't many PHP developers at the conference, and I could really feel the language barrier was a problem (many of the English speaking speakers drew much smaller audiences than the Polish ones), but I met some nice people (such as Neal Ford, Ted Neward and Raymond Lewallen), and in terms of speaker treatment this was by far one of the best conferences I've been to. If you get a chance to speak at one of the conferences that ProIdea organizes, don't hesitate and go!

The amount of speaker dinners/lunches, and long nights in bars with countless Vodka (in the form of so-called 'Polish Mad Dogs') and other alcoholic beverages, and in general the way speakers were supported was amazing! Andrzej, Anna and Magda: thanks for making this a great experience for us, and if you ever do a PHP conference, ping me :-)

Here are the slides from my presentation:

Those who have seen me speak before will notice that this is a more generic version of my "Enterprise PHP" talk, catered to a mixed audience.

This weekend I will be speaking at the 4 Developers Conference in Krakow, Poland.

Since I'll be opening the 'dedicated languages' track, which has a mixed audience of PHP, Ruby and Python developers, I revamped my 2008 Enterprise PHP talk into "Dynamic Languages in the Enterprise" and extended the scope to include Ruby, Python and Perl. Let's see how that works out.

I have never been to Poland before (despite having some Polish roots several generations before me), so I'm excited to be there.

Ibuildings colleague and friend Stefan Koopmanschap will also present, he's doing his 'The Power of Refactoring' talk. Other speakers in the same track are ThoughtWorks's Neal Ford and Ted Neward.

If you are from Poland and know me from the PHP community, come and say hi! :-)

2008 in retrospect

January 11th, 2009 by Ivo

I never did any posts looking back at a previous year, but 2008 has been such a great year that now might be a good time to start such a tradition. I already did a 2008 lookback on our company blog, so I'll stick to more personal things here.

  • In 2008, I had my first book, php|architect's Guide to Enterprise PHP Development published. So far it's been quite succesful, in November it got a spin-off in the form of a monthly column in php|architect magazine.

  • I never traveled so much in a single year. According to Dopplr I did 19 trips. The trips included many conferences (phpUK, InternetWorld, php|tek, DPC, ZendCon, PDC, php|works, phpNW, mswds), visits to customers throughout Europe, an Ibuildings UK/Ireland roadshow and many visits to our London office). Only one of the trips was a short vacation to Paris. Next year should have less travel and more vacation time. Drawback: I gained 12kg in weight from all the trips and conferences. This should come back off in 2009.
  • In April of last year my girlfriend and I bought a house. It was supposed to be finished by December, but it's still under construction and the current estimate is April. I'm really looking forward to the moment it's finished. At the moment we're still busy trying to decide how to decorate it.
  • I wrote 37 blogposts on this blog, the majority of which are in the PHP category. At an average of 3 posts per month, I think that is a good frequency to stick to in 2009. The most successful post has been the Chicken post with over 40 comments.
  • I started using Twitter in January last year. After a year of using it, I can say I really like the service. Despite its many shortcomings and frequent instabilities, keeping in touch with a large number of people in efficient, short messages has a significant added value on top of all my other forms of communication. A good article on why Twitter is not a waste of time, is this one.
  • Back in September, I launched the Elephpant World Tour together with Cal Evans. It's been quite a fun project and the 2008 contest is almost over. (The phpwomen are currently judging the entries.)
  • Also in September, I managed to convince Cal to come work for Ibuildings and move to the Netherlands. Although I am extremely happy to have a once remote friend now close, I feel a little bit guilty for throwing his life upside down like that!

That wraps up some of my, part professional, part personal, highlights of 2008.

2009 should be an interesting year as well. If it's only half as eventful as 2008, it will still be a very good year. We'll see!

Seven Things – Tagged by Matthew

January 3rd, 2009 by Ivo

Oh, the horror.

When chain letter writers discovered email, we quickly dubbed it spam and ferociously flamed everyone that would send us one. Now that they've discovered blogs, apparently we call it 'the first blog phenomenon of 2009'? Damn you for starting this Tony Bibbs! ;-)

But oh well, I can't refuse a tag by Matthew. So let's see if I can find 7 people that haven't been tagged yet.

Here's 7 facts you may or may not know about me:

  • The fist time I wrote PHP code was while studying the PHP manual when Ibuildings offered me a job. This was in november 1999. I was the sixth person to join Ibuildings (although many think I am one of the founders; I'm not, but I am one of the current owners).

  • My fist web scripting experience was writing a mini CMS and template engine called 'PSP' in Perl in 1997, together with Tom Schenkenberg (who later ditched Perl and founded Ibuildings).
  • I once set myself goals in the form of "5 Major Todo's" I would have to accomplish in my life. These are, in increasing complexity:
    • Learn to play guitar (my gf bought me 'Guitar for Dummies' but I haven't really touched a guitar yet)
    • Drive a motorcycle (I've been thinking about taking lessons)
    • Write a book (Done! but now replaced by a todo to write a novel)
    • Run my own company (I founded epointment.com before Google Calendar existed but didn't act quickly enough, so I consider this still a todo).
    • Appear in the end credits of a major motion picture :-)
  • I collect Penguins (plush, porcelain, whatever). I have about 200, by coincidence none of them is a Tux. It makes me an easy person to buy gifts for.
  • I founded my own religion. It's not really a religion, but it's fun to be able to say that. :)
  • When I was a small boy, I wanted to become an astronaut, an architect or a designer of Lego sets. I became interested in computers when mum got one for work (I think it was an AT or XT and I remember being confused by the "Abort, Retry, Ignore, Fail" question it so often asked me; I still do not know what difference it made). My first own machine was a Commodore 64.
  • I've never touched drugs (if we don't count alcohol). The fact that some of it is legal in Holland does not mean that everybody does it (contrary to popular belief). Nor did I ever own wooden shoes.

Those are my seven things. And here are the people I tag:

  • Felix de Vliegher, for his involvement in the Dutch and Belgium PHP communities (and to make it more difficult for Stefan and Michelangelo to find 7 people to tag :-) ).

  • Remi Woler, one of my favourite PHP developers at Zend.
  • Beth Tucker, Editor in Chief at php|architect, as a payback for her giving me crazy deadlines :)
  • Mikko Koppanen, author of the PHP Imagick extension and one of my coworkers in the UK.
  • Shahar Evron, product manager and smart guy at Zend

(yeah, that's only 5, but we're running out of people to tag way too fast :-) )

And here are the rules I'm supposed to pass on to the above bloggers:

* Link your original tagger(s), and list these rules on your blog.
* Share seven facts about yourself in the post - some random, some wierd.
* Tag seven people at the end of your post by leaving their names and the links to their blogs.
* Let them know they've been tagged by leaving a comment on their blogs and/or Twitter.