Facebook announced the release of XHP yesterday. It is an extension for PHP which provides enhancements to the PHP language syntax and gives the language some convenient capabilities.
In this post I will provide you links to the essential sources of information about XHP, show some XHP sample code, and discuss the installation process for XHP on Ubuntu with Apache and PHP5.
<?php
require_once('/home/cal/facebook-xhp-290b185/php-lib/init.php');
$name = 'Calvin Freitas';
$title = "{$name} loves XHP!";
$url = 'http://calvinf.com/';
$permalink = 'http://wp.me/pcoLC-4e';
#create a <head> element
$head =
<head>
<title>{$title}</title>
</head>;
#create a div
$div =
<div id="header">
<h1>{$title}</h1>
</div>;
$body =
<body>
{$div}
<div>
<p>My name is {$name} and you should go visit <a href={$url}>my website</a> now.</p>
<p>Read my <a href={$permalink}>guide to installing XHP on Ubuntu</a>. It includes the source code for this page. Comments and corrections are welcome.</p>
</div>
</body>;
echo
<html>
{$head}
{$body}
</html>;
?>
A few syntax notes
XHP forces you to properly nest tags — make sure you close them properly or it won’t compile and it will throw errors. Because XHP auto-escapes, when you’re creating a link (such as in an a element), you don’t need to put quotes around it.
<a href={$permalink}>guide to installing XHP on Ubuntu</a>
Installing XHP on Ubuntu
Server: Ubuntu 9.10 running on a slice at the Rackspace Cloud.
Web server: Apache 2 Apache installation guide (Slicehost article, but generally applicable)
Sam Javanrouh is my favorite photographer at present. He takes incredible photographs and also does the occasional video. The video below, Toronto on Ice, is one such example.
WordPress 2.9 has been released and is available for download. The most important new features are a new “trash” system for deleting posts or comments, a built-in image editor, batch plugin updating, and easier video embedding.
On a related note, Elitwee MyTwitter 3.0.3 is compatible with WordPress 2.9 and is a great way to include your tweets as a widget on your WordPress blog.
I have written a PHP 5 library for the Posterous API. It uses the curl extension to query the Posterous API, retrieves the XML, and returns the XML as a SimpleXMLElement.
The Elitwee MyTwitter 3 Plugin for WordPress has been released and is available for download now from the WordPress Plugins Directory.
Description: Elitwee MyTwitter is a simple tweet widget and status updater for WordPress.
What’s New?: This new version allows you to easily add one-or-more Twitter widgets to any widget-enabled WordPress theme. You can also post updates to Twitter directly from the plugin’s Settings page. It is compatible with WordPress 2.8 and higher.
I’ve updated the custom theme for my website! Look at it now.
I spent today finishing the code for the custom WordPress theme I use to power the layout and design of the site. Many thanks to Jason Oxrieder for doing the graphic design work behind the new look!
The new design is just one example of the custom WordPress development I am able to do. I provide WordPress consulting and can answer questions about topics related to customization, themes, plugins, settings, system administration, and more.
I found myself surprised at how often I agreed with the words of PG or the entrepreneurs he quoted within. My experience working at Athleon has taught me many of the lessons he mentions within his essay. Particularly, the lesson that entrepreneurs work on a different time-flow than the rest of the world, and the emotional roller coaster a startup can be.
Over the course of the past year, I have loved working with Brent, Ryan, Jason, and Dan on Athleon and I am incredibly proud of the product and how far it has come in a year. With this small team of 5 (now 4), we have launched All Team Apparel, the Game Film beta, an updated version of Playbooks, and rewritten large components of the back-end code (running on Debian Linux, Apache 2, MySQL, and Perl with some features written in Flex/AS3) to prepare the site to scale for future growth.
Nobody says startup life is easy. The past year has not been, but I wouldn’t do things differently. The lessons I’ve learned have been valuable, hard-earned, and worth it.