php|works day 1

The first day of talks is now over, and all in all I found it quite informative. so what did I learn?

The day started with a keynote speech from Andrei Zmievski called, “The Future: PHP 6”. The main gist of the speech was to let us know that PHP 6 is basically PHP 5 with Unicode support. Up until now I have just thought of PHP 6 as something that holds only a small amount of interest for me, but nothing I’ll use for quite some time. That goes especially so at work, where they’ve only just got a PHP 5 server installed a number of months ago! But now, having heard Andrei talk about PHP 6, I am very interested in using it.

Unicode is going to be full integrated in to PHP 6, everything from the lowly string functions to PDO, PCRE, SimpleXML and all the rest. Andrei demonstrated this with example code that showed strip_tags removing HTML tags from complex strings containing two different sets of languages, using strlen to return the number of characters (as people use it now – although it actually returns the number of bytes), and similar examples.

Something else I found really interesting with PHP 6 is the fact that you can actually have variable, class and function names all in Unicode! This, I’m sure, is going to be great for those people that want to code in their native language (though impossible for me to read! 😉 )

Internationalization (i18n) is handled in a PECL extension (pecl/itnl). Not sure why it’s not integrated in to PHP 6, but I think it was down to the fact that they wanted to offer PHP 5 the same functionality. The i18n features are really cool – giving you the ability to represent numbers, currency, date and time in a localized format.

Really; there’s no excuse not to install PHP 6 when it becomes stable, and I’ll certainly be badgering work to do that.

The next session I attended was Maggie Nelson’s “You don’t need a DBA”. The talk was about good practises when designing database, such as using primary and foreign keys, normalization and stored procedures. Maggie seemed quite nervous, bless her, but I took a lot from it – even though it was mainly focused around Oracle. At work there is a team of very good Oracle developers who know infinitely more about the subject than I do, and on private/freelance projects I tend to use MySQL. Thankfully, though, the topics talked about were quite database agnostic and can be applied to MySQL (well, MySQL 5+, at least) as well as they are Oracle. Stored procedures are certainly something I’d like to use more as it really keeps all the database procedures together (and a lot of data processing can be done on the db level as opposed to only within the PHP script!)

Straight after that came Ben Ramsey’s talk on “Designing RESTful Web Applications”. Lots of information here on the concept of REST and some good real-life code examples on connecting to services such as flickr and I’m looking forward to getting the slides for this to help me refactor a ‘RESTish’ service I created at work to actually be ‘RESTful’.

After lunch came another keynote speech, this time by Chris Shiflett and titled “PHP 4 is dead! Migrate your code”. Essentially it was just telling us what we already know; PHP 4′ EOL is on 08/08/08, PHP 5 is great, update your code. But Chris’ presentation was very funny and enjoyable. I’m looking forward to hearing him speak tomorrow on ‘Security 2.0’.

Paul Jones was up next with his “Organizing your PHP projects”. The outcome of this was basically to not use global vars at all, write your applications as if writing for a library, namespace everything to avoid conflicts (while remembering to use sensible namespace names and not things like ‘Date’ or ‘Html’), and use the class-to-file naming convention (such as Component_Db_Table would refer to the directory Component/Db/Table).

As I’ve been working with the Zend Framework recently I really took to heart what Paul was saying, as it’s a library with good conventions and structure.

Finally came Jeff Moore’s “Configure $this” talk. This focused around the Dependency Injection pattern, refactoring code so as not to use concrete classes and things like that. I have to admit, I didn’t come away with a lot from this one. Not because what Jeff was saying wasn’t interesting because it was (albeit he was the least animated speaker today), but I think because it was outside of the realms of the work I do, and the fact that I’m not full up-to-spec with my knowledge of design patterns. This is another that I think the slides would really help with.

And that was it for day 1!

There is a party a little later on – a chance to network – or as I like to think of it; a chance to drink beer and not talk very much at all. Actually, I’m really hoping to be able to give out some of my business cards today… Not because I think people will want to contact me, but because I have some really kick arse cards from Moo! 🙂


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.