News Archive
PhpRiot Newsletter
Your Email Address:

More information

PHP Content Repository: Full implementation in sight

Note: This article was originally published at Planet PHP on 4 December 2010.
Planet PHP

Recently, I put a finishing cleanup on the PHPCR API, the port of the Java Content Repositry API (JCR) to PHP. PHPCR is implemented by Jackalope, which got a whole team at Liip working at it to fix the failing tests and fill in missing bits.

You might have heard that we started to port the Java Content Repository (JCR) standard to PHP. If not, read the Jackalope post from last year.

The JCR is a Java standard for storing content. Probably the best way to think of it is as a file system with flexible meta data and a couple of extras like query, versioning or access control. It is used in CMS and DMS systems, for exapmle Day Communique or Alfresco.

With lots of input from Benjamin Eberlei and discussions on the Symfony2 cmf project mailing lists, I stripped all Java specific stuff out of the PHPCR API, making it more PHP. Most notably, we got rid of all the elements that are only relevant in strongly typed languages. Plus PHPCR now specifies to use the standard PHP iterators instead of specific classes that could not be used in foreach. If you had a look at the earlier interfaces, you will notice that we now use the PHP 5.3 namespaces. A full list of the changes is documented in from JCR to PHPCR.

While PHPCR defines the API, Jackalope is an implementation of that API. In the last few weeks, things got a real boost, as a full team at Liip is completing the implementation. We aim to have a beta release of Jackalope ready by the end of the year. Our implementation talks to the Java Jackrabbit backend for data storage. This is a quite performant setup, plus it allows to access data in existing Jackrabbit-based products. Ideas exist how we could write a PHP-only storage layer, but for now, we focus on creating a fully working implementation with Jackrabbit. First performance tests are quite promising. Chregu did a couple of performance tests and found that Jackrabbit scales really well. Having 15 Jackrabbits share one database backend with 350'000 nodes and doing requests scaled linear and the database did not get overloaded. Ask him for more details - maybe he is writing a blog post about the performance topic.

Our plan is to use the PHPCR standard as a storage backend for the upcoming Symfony2 cmf (content management framework). We already started to build a Symfony2 jackalope bundle. If you are more interested in the cmf than in the underlying storage: Stay tuned, we hope to release a doctrine2 binding for PHPCR soon and then go further with the cmf components beginning of next year.

By the way:AWe have a concrete use case for the whole cmf. Liip is using it to re-build a large and well visited website. More on this some time next year.

Architecture concept for the cmf with PHPCR/Jackalope.