What is it?
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
- For hierarchical navigation structures
- For compound data that belongs together. i.e. a web page with attached files or translations
- You need to version content
- You want full text search
When not to use PHPCR
PHPCR is targeted at semi structured content. For strictly structured content and when using aggregation queries, we recommend using relational databases.
For example: A web shop where products are stored in PHPCR, orders are stored in a relational database.