Facebook releases 'HipHop' - a PHP 'compiler'

I stumbled across something called 'HipHop' from Facebook :

Here is how Sebastian Bergmann describes it :

"HipHop for PHP" is a source code transformer that turns PHP 5.2 code (minus some features) into C++ code that can then be compiled with g++, for instance, to a regular binary.

Since much of the Facebook front-end is written in PHP, they found HipHop necessary to reduce their need for servers.

Here are a couple articles on this :


Installing PHP's Testing_Selenium on Windows

Earlier I blogged about setting up Selenium, PHPUnit et al on an Ubuntu machine.

Although I prefer to do web development on an Ubuntu machine, for 'legacy' reasons I still do some stuff on a Windows machine. For lighter web interface testing, a full CI tool like Hudson is overkill. Here's how to run Pear's Selenium_Testing alone (without PHPUnit) on Windows.

I assume you have PHP and the Pear installer on your Windows machine. Grab the Pear Selenium_Testing package with :


Writing a simple OO template system in PHP to separate logic and presentation

If you're maintaining a legacy PHP application which suffers from mixing of application logic and presentation, you may want to implement a simple template system to help separate these two.

Of course there are plenty of existing PHP templating systems, with Smarty being one of the most 'notorious' ;-). But if you have simple needs and don't want to introduce external dependencies to your code, rolling your own simple system can make sense. Let's face it -- you can often roll your own in the time it takes to figure out someone else's system.


Simple Progress (Load) Bar with jQuery

Let's say you need to load some info into a page, but the info requires some time to process. You don't want to have the user staring at a blank screen during the processing, so first load the page with a busy (progress) bar image and then replace the image with the actual data when ready.

Assume you have this HTML page :

  <script type="text/javascript" src="/js/jquery.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {

Cheap PHP lint checking with Git

Running PHP's "built-in" lint checker (php -l) is a quick way to remove syntax errors which should never creep into your code.

However, you'll no doubt soon tire of typing "php -l" before every Git commit message, so why not let Git do the checking for you with a "pre-commit hook".

Travis Swicegood has a great article on how to set this up with Git :

I found you could pretty much copy his pre-commit PHP script and paste it into your .git/hooks directory with a couple caveats :


    Running Selenium PHPUnit tests against Firefox in an Ubuntu virtual machine

    As part of my Hudson CI server, I'm trying to run Selenium-based PHPUnit tests with each build. The build machine is an virtual machine (VirtualBox) running Ubuntu desktop.

    Initially, my tests weren't running thru Hudson and the associated build.xml file. This wasn't surprising since I had forgotten to start the Selenium RC server.

    Useful Drupal "Third-party integration" Modules

    Using the Hudson Continuous Integration (CI) tool

    I recently started writing some automated Selenium (Se) tests . I wrote a few tests, and Se seems to work well. But after writing a few tests, I found I needed an easy way to run, report, and track test results.

    This lead me to Hudson, a Continuous Integration (CI) tool.

    Hudson builds a given project and then does a number of useful things :

    • Automatically run unit tests and provide coverage reports
    • Show style, syntax, and complexity results

    Setting up Custom Coding Standards with PHP CodeSniffer

    PHP CodeSniffer provides you with some useful coding standards to get you going.

    This is nice, but how do you customize what's provided or set up your own standards?

    There is a tutorial on how to set up your own standards, but that was too much work for me at the moment.

    However, that is NOT the way to set up your own standards, in my opinion.



    Subscribe to luhman.org RSS