Issue Details (XML | Word | Printable)

Key: JSR_333-28
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Christian Stocker
Votes: 3
Watchers: 4

If you were logged in you would be able to see more operations.

Define an API for PHP (aka PHPCR)

Created: 07/Apr/11 04:40 AM   Updated: 10/Jun/11 12:37 PM   Resolved: 10/Jun/11 12:37 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Participants: Christian Stocker, dbu, lsmith77 and Peeter Piegaze

 Description  « Hide

While JCR was specifically written for Java in mind, initiatives were started to port the API to other languages, specifically in this case PHP. There's the project Jackalope ( which implements a "Jackrabbit" client in PHP (using the webdav protocol). Jackalope uses the PHPCR interfaces, which were originally created by the Typo3/Flow3 team and were slightly adopted to some PHP specifics, but directly derived from the JSR-283 specs (, the changes are described here And just lately the midgard project also started with using the PHPCR interfaces (

We'd like now to propose making PHPCR more official and to include it in the next release of the JCR specs, so that there is an agreed "standard" and also that we can solve some legal issues (regarding derived work of the original JCR specs)

lsmith77 added a comment - 07/Apr/11 04:53 AM

The popular Symfony PHP framework is using PHPCR for their CMF initiative:
To ease development we have also created an ODM (object document model) layer using the popular Doctrine2 (sort of a Hibernate for PHP):

In other words there is considerable commitment behind PHPCR already. The goal is to formalize this especially to ensure that different implementations like Jackalope and Midgard will play nicely with eachother, but also to ensure that PHPCR and JCR stay compatible.

In a second step we might also want to look at adding some things into JCR that scripting languages in general would appreciate (for example native support for associative arrays).

dbu added a comment - 08/Apr/11 10:51 PM

note that we are currently in the process of separating the phpcr interfaces from the jackalope implementation to make it more obvious what is the standard. will become

Peeter Piegaze added a comment - 12/Apr/11 01:05 PM

What would be the most logical first step? Presumably we would want to include the source and auto-generated docs in the package just as we now include the java source and javadoc. But in terms of adapting the spec itself, would it be sufficient to include a new section containing, essentially, the information in or would we need to change more of the spec?

Christian Stocker added a comment - 12/Apr/11 11:51 PM

Yes, I think this would be a sensible approach. Provide the interfaces with source and auto-generated docs. And explain the differences and common conversions from the Java-interfaces in a chapter in the specs.
Once the JSR-333 java interfaces are "ready", we adopt the current PHPCR interfaces and go through all the methods and document the differences (like eg. all the overloaded methods we merged into one)

I guess it would be good, if we document all changes in the doc, but I guess it doesn't end up in much more than is already in the JCR_TO_PHPCR.txt doc

dbu added a comment - 15/Apr/11 06:41 AM

yes, JCR_TO_PHPCR is more or less complete. there was some stuff added to the phpcr api later, but i think its debatable if it makes any sense to have that there (we could also make it impl specific)

what really needs a good final decision is binary handling. we half-use the BinaryInterface and should decide what we really want (with respect to performance and future proof).

Peeter Piegaze added a comment - 10/Jun/11 12:37 PM

The PHPCR code has been added to svn, and the PHPCR section has been added to the spec.
The section needs a bit of clean up and may change as features are aded to PHPCR. But, I'm going to close this issue and add separate issues for cleanup and locking etc.