Scaling web applications with HMVC

The last decade has been witness to the second iteration of web design and development. Web sites have transformed into web applications and rarely are new projects commissioned that do not involve some element of interactivity. The increasing complexity of the software being developed for the internet fuelled a requirement for structured and considered application design.

PHPLOC: PHP lines of code

With the growing use of continuous integration and static analysis tools hooked into those processes, there is a particular analysis tool that is very useful but rarely mentioned: phploc, the PHP Lines of Code tool. This has been a feature of PHPUnit for some time but has been released as a separate project in the phpunit pear channel. The nature of PHPUnit means that many of these statistics can be collected while the tests are running, which is why it was added to that tool in the first instance.

Transforming XML with PHP and XSL

If you want to transform XML from one format to another, and especially if either the input or output XML is complicated or the transformation itself is difficult or awkward to express, then XSL may be a good choice. XSL is the eXtensible Stylesheet Language; a family of three W3C recommendations to do with the transformation and presentation of XML documents. This article will walk through some examples of how XSL and PHP can be used to achieve these types of XML tranformations.

Profiling with XHPROF

If there's something we developers are really bad at, it's guessing. We think we know which parts of our application are slow, and spend a lot of time optimising those, but in reality the bottlenecks are often somewhere else. The only sane thing to do is measuring, with the help of some profiling tools.

Using PHP_code_sniffer

PHP Code Sniffer (PHPCS) is a package for syntax checking, available from PEAR. It can check code against defined rules covering anything from whitespace through doc comments to variable naming conventions and beyond. In this article we'll look at getting started with PHPCS, using it to syntax check our files, and go further to look at how the rules are create and the standards defined.

Graphs in the database: SQL meets social network

Graphs are ubiquitous. Social or P2P networks, thesauri, route planning systems, recommendation systems, collaborative filtering, even the World Wide Web itself is ultimately a graph! Given their importance, it's surely worth spending some time in studying some algorithms and models to represent and work with them effectively. In this short article, we're going to see how we can store a graph in a DBMS.

Getting started with Memcached

Memcache is a tool which can cache objects in memory – and is often used for speeding up dynamic web applications. PHP has a built-in module for working with memcache, and its a simple and convenient way of introducing caching to your application. PHP has a PECL module for talking to memcached – look up how to install for your system, but be aware that it isn't bundled. It's a good module to include on your system however, quite a few apps will take advantage of it where available.