So in the end we were three Liipers to set off for Verona and we were about to meet some more there (including two ex-Liipers). So Liip was quite well represented, which was also noticed by the organizers ;-).
The two conferences were hosted by the italian PHP user group
and the guys did an awesome job. Hey, they even produced a PHPDay shirt for girls. According to them they are the first PHP conference doing so. So, *thumbs up*.
So, what did we actually learn during those four awesome days in Italy?
The introduction talk "Even Faster Websites" was given by Steve Souders
Moreover I attended talks about the current state of HTML5 (slides
), introductions to node.js (slides
For me PHPDay started with a workshop about caching by Fabien Potencier, starting off with the question about who in the room has already read the HTTP specification. We learned a lot about the different caching headers and what impact they have in what server setup. After the theory we played around with the different headers with a small silex app. Find more details about that workshop in the blog post
by Patrick Zahnd.
RESTful web services
Another very interesting talk was given by David Zülke, chief developer of the Agavi framework, about how to define RESTful web services. With real world examples of badly designed APIs (e.g. the twitter API) and explaining how it could be done better he explained very well what is important when designing RESTful web services. Find more details about that talk in the blog post
by Patrick Zahnd.
Profiling your PHP application
Lorenzo Alberton suggested in this talk some tools that can be used to profile your PHP application, mainly xhprof that was developed by facebook. He also explained how to interpret the results of such a profiler and where to start looking for possible problems. Some examples:
- if a website accesses the database, these calls should usually be at the top when sorting the profiler data by CPU usage
- when sorting the results by number of function calls find out if that function really needs to be called that often or is the call maybe in the wrong place, e.g. inside a loop where it could also be outside
He also gave some hints on how to optimize some things on system level, for example:
- if you don't use htaccess files turn it off in your server config, otherwise the server searches for those files needlessly
- always put a favicon.ico into your project so there is no error and the 404 error handler is not triggered in the case where you use a framework
Find more interesting optimizations here
Oh, and by the way, don't use PHP error suppression. One reason is what PHP does when it encounters an @: it sets the error reporting level to 0, executes the function, formats the error messages and only then it actually checks the error reporting level. More reasons why you should not use it can be found here
I've also seen a talk about how dependency injection works (slides
) and from the same guy a talk about how to test untestable code, giving some ideas about how to mock certain services like mailing in non-tested legacy applications so they can be tested (slides
The talks were very interesting, the venue was beautiful (go to Verona if you've never been there, best next year for the PHPDay 2012 ;-)) and people were awesome.
See you at PHPDay 2012!!!
Your email adress will never be published. Comment spam will be deleted!