Fork me on GitHub

PHPCR - Content Repository for PHP

The PHP Content Repository is an adaption of the Java Content Repository (JCR) standard, an open API specification defined in JSR-283.
The API defines how to handle hierarchical semi-structured data in a consistent way.

The typical use case is content management systems. PHPCR combines the best out of document-oriented databases (weak structured data) and of XML databases (hierarchical trees). On top of that, it adds useful features like searching, versioning, access control and locking on top of it.

When to use PHPCR

When not to use PHPCR

PHPCR is targeted at semi structured content. When you have strict content and need to aggregate the data, PHPCR is not the tool of choice. We recommend using relational databases for this.
For example, when building a web shop, the products could be stored in PHPCR while the orders can be stored in a relational database.

Implementations

PHPCR defines the interfaces for content repositories. There are several implementations available that you can use: