support ModeShape as a PHPCR persistence layer
lsmith77 Oct 24, 2012 7:45 AMI am one of the lead authors of PHPCR and the PHPCR reference implementation Jackalope.
The aim is to create an API that takes the concepts of JCR but follows the philosophie of PHP. This means that anyone experienced with JCR will quickly be familiar with code written for a PHPCR implementation. All the concepts like tree's, references, SQL2 search, workspaces etc are all also available in PHPCR.
The reference implementation uses Jackrabbit as the persistence layer via their Davex HTTP API:
https://github.com/jackalope/jackalope-jackrabbit
This means it is possible to write PHP code that reads/creates nodes stored in Jackrabbit. We recently did a proof of concept where we interfaced with the Jackrabbit instance underneath the Magnolia CMS to exchange data. I even did a presentation at the annual Magnolia conference about the results:
https://dl.dropbox.com/u/268634/PHPCR-and-Magnolia.html#1
What this means in short:
- its now possible to build sophisticated CMS solutions on top of PHPCR
- it is possible to integrate PHP with Jackrabbit based CMS solutions
- since there are multiple implementations its possible switch storage layer more easily
There is of course an extensive test suite to test compliance (next to Jackalope there is also a C implementation) which we automatically test against on travis-ci.org:
https://github.com/phpcr/phpcr-api-tests
I recently learned that ModeShape also exposes some of its functionality via REST API. Furthermore ModeShape has some interesting features missing in Jackrabbit, like a much more powerful and performant SQL2 implementation. So it would be interesting to also have a PHPCR implementation based on ModeShape.
While a full PHPCR implementation is quite a significant time investment, the good news is that Jackalope, the PHPCR reference implementation, separates all the in memory management and node validation etc from the actual persistance via a set of so called transport interfaces. The above link to jackalope-jackrabbit is only the code necessary for the implementation of the transport interfaces for Jackrabbit. The key classes can be found here:
https://github.com/jackalope/jackalope-jackrabbit/tree/master/src/Jackalope/Transport/Jackrabbit/
The transport interfaces are here:
https://github.com/jackalope/jackalope/tree/master/src/Jackalope/Transport
I must admit we still have our hands full with work on the current transport implementations (Jackrabbit, Doctrine DBAL, MongoDB) so we will likely not soon have the time to start on a ModeShape implementation. So I am writing this message mainly for two reasons:
1) to validate the importance of working on exposing as many features as possible via an HTTP API
2) to see if there is someone within the ModeShape community that sees a need for better integration with PHP and is willing to start the effort (we would certainly be willing to support this effort with advice)
BTW: we also have a layer on top of PHPCR, called PHPCR ODM, which provides a hibernate like object persistence mapper but with native support for most of the PHPCR features. Additionally it covers an API to deal with i18n of class properties.
BTW 2: Would also be interesting to have ModeShape run its own test suite on travis-ci.org. Jackrabbit OAK runs its test suite on travis: