PHP Content Repository: Full implementation in sight

3.12.2010

I repost some of my blog posts made @ liip. Please see here for the original post and comments: http://blog.liip.ch/archive/2010/12/03/php-content-repository-full-implementation-in-sight.html



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: We 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.

symfony content management cmf