HipHop für PHP

Der Schleier wurde gelüftet: Facebook hat mit »HipHop« einen Source Code Umwandler veröffentlicht, der PHP-Code in höchst-optimierten C++ Code konvertiert. Dieser wiederum wird dann mit g++ kompiliert um maximale Performance zu erreichen.

Bei Facebook brachte der Einsatz von HipHop eine durchschnittliche Reduzierung der CPU-Auslastung um 50% – natürlich abhängig von der jeweiligen Seite. Für Facebook bedeutet weniger CPU-Last weniger Server – und damit weniger Kosten. Aber natürlich bedeutet weniger Auslastung auch weniger Energieverbrauch.

In seinem Blog-Beitrag schreibt Haiping Zhao »We are proud to say that at this point, we are serving over 90% of our Web traffic using HipHop, all only six months after deployment.

How HipHop Works
The main challenge of the project was bridging the gap between PHP and C++. PHP is a scripting language with dynamic, weak typing. C++ is a compiled language with static typing. While PHP allows you to write magical dynamic features, most PHP is relatively straightforward. It’s more likely that you see if (…) {…} else {..} than it is to see function foo($x) { include $x; }. This is where we gain in performance. Whenever possible our generated code uses static binding for functions and variables. We also use type inference to pick the most specific type possible for our variables and thus save memory.

[…]

Overall HipHop allows us to keep the best aspects of PHP while taking advantage of the performance benefits of C++. In total, we have written over 300,000 lines of code and more than 5,000 unit tests. All of this will be released this evening on GitHub under the open source PHP license.

Der ganze Artikel (englisch) im Facebook Blog: http://developers.facebook.com/news.php?blog=1&story=358

Quality Assurance in PHP Projects

Derzeit entsteht ein viel versprechendes Buch mit dem Titel »Quality Assurance in PHP Projects« in Deutsch und Englisch, geplante Veröffentlichung im vierten Quartal. Im Buch soll umfassendes Fachwissen und Erfahrungen zur Qualitätssicherung in Web-Projekten vermittelt werden.

Wenn die Hütte brennt, werden Überstunden gemacht und Urlaube abgesagt, aber trotzdem meist Termine und Qualitätskriterien verfehlt. Da aber Software viel länger lebt als ursprünglich geplant, gehen die Probleme erst dann richtig los, wenn später weitere Änderungen und Erweiterungen notwendig werden.

Die Autoren: Diplom-Informatiker Sebastian Bergmann, Autor von PHPUnit, und Stefan Priebsch, Spezialist für PHP-basierte Software im Unternehmenseinsatz.

Zend Framework in Version 1.8 erschienen / Tutorials

Am ersten Mai-Wochenende ist das Zend Framework in Version 1.8 erschienen. Neu ist, neben Zend_Application, Zend_Navigation und Zend_Tag_Cloud zum Beispiel auch das Zend_Tool:

1.8.0 marks the first public release of Zend_Tool. At its simplest, Zend_Tool provides a command-line script that can be used to ease many common project-related tasks

Passend dazu hat Kim auf Designpicks seine »Top 5 Zend Tutorials« gelistet:

Ich beschäftige mich zurzeit intensiv mit dem Zend Framework und habe festgestellt, dass es gar nicht so leicht ist, gute Tutorials dafür zu finden. Nach langen Recherchen möchte ich euch hier die (meiner Meinung nach) besten fünf mitteilen.

PHP-Intrusion Detection System

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application. The IDS neither strips, sanitizes nor filters any malicious input, it simply recognizes when an attacker tries to break your site and reacts in exactly the way you want it to. Based on a set of approved and heavily tested filter rules any attack is given a numerical impact rating which makes it easy to decide what kind of action should follow the hacking attempt. This could range from simple logging to sending out an emergency mail to the development team, displaying a warning message for the attacker or even ending the user’s session.

http://php-ids.org/

Piwik Update veröffentlicht

Piwik 0.2.33 released! No bugs left, and lots of good stuff coming.

After a month of bug fixing, please enjoy using the latest release of the most popular Open Source Web Analytics software! We believe we’ve fixed all outstanding bugs in Piwik (36 to be exact) and we’ve pushed a few improvements as well. Our objective for this release is to open the way for Piwik 0.4 that will include a few important new features (multi sites dashboard, new modular Javascript API, and more) and provide a great stable web analytics tool. Download Piwik, spread the word, and enjoy your data!

From the Piwik Blog