Yesterday, Facebook released HipHop for PHP, a compiler which makes native code from PHP sources (via C++ and gcc). They promise twice the speed with that approach, something which helps you a lot if you have 1000s of servers like Facebook. I won't bore you with the technical details and what it can and can not do as Ilia already summed that up pretty nicely.
We at Liip will certainly look into this technology once it's available and evaluate if it would makes sense for some of our customers and project. As HipHop is not a drop-in replacement for your existing setup this is something which has to be planned and tested carefully. You have to change the way your servers are setup and the way you develop and deploy. It even needs a server restart, if you change some code, so badmouths can now claim that PHP is even more becoming like Java :)
A high amount of Switzerland's most visited sites run on PHP (and some of them are even done by or with us) and maybe HipHop could be useful for some of them, after all the usual optimizations (like APC, memcached, etc) didn't help enough. But for most websites (and more so for small ones), PHP's speed isn't really the bottleneck, it's the database or some other external dependency. And for these cases HipHop isn't the holy grail. So before you change all your setup to fit into HipHop's requirements, do some decent evaluations, what really is the bottleneck in your application and decide accordingly.
For a larger project here at Liip Zurich, we are looking for an experienced Magento PHP Developer. Start as soon as possible. Freelance is ok, but you have to be able to work with the team here in Zurich onsite (most of the time). This also means: No interest in outsourcing, off- and nearshoring or however you call it. We just need a person fully integrated into our already existing Magento team. If you're interested get in contact with Nadja Perroulaz (contact@liip.ch) or me.
Furthermore we're (always) looking for an experienced PHP/Javascript Web Developer. If you're interested in a job where you can learn and develop new stuff almost every day and work on exiting projects and if you have a lot of experiences in the PHP/JavaScript/Web World, do not hesitate to send us your application. The ad linked above is in German, if you don't understand it and want to know more, I'm here to help. Knowing German is no prerequisite for a Job at Liip :)
Last week I gave 2 techtalks (one in Fribourg and one in Zurich) about how we use some of the "Real Time Web" technologies in Flux CMS and its related services. The graph for this looks like that:
I also plan to write some blogposts about some of the technologies used as the blue ones in the graph are written by us and Open Source (see the links at the end of the slides). And I really hope it will end up in more than just a plan :)
If you want to know something in particular before I write those posts, just ask in the comments.
by Jordi Boggiano
@ 28.09.2009 10:47 CET | PHP | Open Source
The idea behind sending emails on every svn commit is basically to help developers review their peer's code, which improves both awareness of the global codebase and overall code quality since errors might be picked up and go or bad coding practices can be identified and discussed between the developers.
While we have had svn post-commit hooks set up for a while at Liip for some of our bigger projects, the case of smaller ones that occupy very small teams remained problematic. The main issue being that configuring the classic post-commit hooks requires intervention on the svn server, to which not everybody has access, and since small projects might change often this can be annoying both for the sysadmins and for the developers that have to depend on someone every time they want a new svn directory to be watched.
The idea we came up with is to use svn properties as the configuration for the post-commit hook, so that anyone with commit access can set it up, and it can easily be applied to any number of directories.
The script looks up through the parent directories of every modified/added files in a commit, with a svn propget liip:review call, and once one is found, the value of the property is used as the email "To:" address(es). This means you can easily have an entire project being watched by someone, but some particular sub-directory of it will only be watched by some other persons, for example if you want to extract the xsl commits out of a php okapi project you would just add another liip:review property on the themes directory.
It is fully configurable if you want to try it for yourself, you basically need to give it the svn server url and the property to check for, then some other extras are available. To allow easy filtering in mail clients the mails sent contain a X-SVN-Commit-Mail header with the value being the name of the repository. Also the subject contains the committer name, revision and watched-paths affected.
You can get the script off of our public svn repository at https://svn.liip.ch/repos/public/misc/svnwatch/ - the dispatch-emails.php script uses the svn binary and the dispatch-emails-ext.php uses pecl's svn extension for php if you prefer.
We all love regular expressions, don't we? Well I usually do, but recently I lost quite a lot of time to find out this bit of particular behavior, so i thought i might share this.
Greedyness is basically the question whether an expression matches as much as it can, or as little as necessary. You find an excellent explanation and examples here. The default is to match as much as possible. The syntax *? , +? and ?? makes the quantifiers non-greedy. However, even the non-greedy expressions may match more than you expect.
The ".*?" after the href=" tells the regexp engine to match non-greedy. If we omit the non-greedy order, the expression would generate one single match of the whole string. The non-greedy version generates two matches. But the first match is not the absolute minimum match on the input string:
<a href="/link">Label</a> <a href="/en">[en]</a>
The non-greedyness seems to result in the expression generating the maximum number of matches, but not necessarily the smallest possible match strings. A fixed regular expression to only match the language links would be this expression, which explicitely excludes the closing quotation mark from the match.
Since we did not make it to the 5.3 release party in Munich, we decided to record a little video instead. Memi, our resident movie director, steered the camera and took care of the post production. Since we had a fair number of visitors from the Fribourg/Bern offices, we managed to put together a fairly representative \a-ho\a-wave.
At Liip we have been closely tracking the development. Actually through my role as release manager probably more than close. Long before 5.3 was released we had already made sure that OkAPI, FluxCMS and friends are running smoothly with the upcoming release. So soon we will start launching our first projects using PHP 5.3, leveraging the new features and enjoying the nice improvements in performance.
NextWebtuesday is soon. As Sebastian Bergmann is giving a testing workshop that day for the Liip employees, we thought that would make a perfect fit for an interesting talk at the webtuesday. Sebastian will be talking about PHP 5.3 and its many new features with focus on closures.
It's at the Amiado Offices in Zurich with roof-top beer afterwards. Bring your own beverages, but some is sponsored :)
If you want to come, it would be nice if you write your name to the webtuesday wiki.
From time to time I write some little scripts for my own needs or just to test out new stuff. And I realised, that I blog about it way too little. So here I start with my latest addition: Zend_Auth_Adapter_Twitter
The occasional webapp needs a login for managing users. Doing that by yourself is 1) cumbersome and moreover 2) very outdated (who likes to remember login/password for each and every site). As I was playing with oauth for Twitter anyway lately, I came up with a Zend_Auth Adapter for Twitter. The integration was pretty easy, but the code is very basic and rough. Nevertheless, it does the job and alongside the Openid Adapter I can offer a federated login for many people already. Now, someone should do a Zend_Auth_Adapter_Google :)
Some days ago I released a little bugfix release of the PHP extension uploadprogress. It fixes one nasty bug with cleaning filenames with preceding whitespace, so an upgrade is highly recommended. It furthermore improves tmp-directory detection, but can only do this during compile time.
Last but not least, the example was improved. It checks for more possible wrong settings (like if the tmp-directory is there and writeable) and gives more feedback. Due to the nature of how this extension works, it may be a little bit tricky to get it working, but the example should help. See also the "Common issues and some answers" post for some hints.
by David Buchmann
@ 18.06.2009 20:22 CET | Blogging | PHP
I had to relaunch a web site using Serendipity with a new Drupal installation. The old site had about 100 blog posts and lots of comments we did not want to lose. After some googling, i found this excellent blog post on creating drupal nodes programmatically and this useful resource on drupal node fields. i knocked up the following script that does the job. Just copy this to s9y-import.php and place it in your web root and call it in your web browser. Please back up your database in case something goes wrong (believe me, if you have no backup, it will go wrong!). You might want to read the code comments to know about the current limitations.