phpcr/phpcr
Composer 安装命令:
composer require phpcr/phpcr
包简介
PHP Content Repository interfaces
关键字:
README 文档
README
This repository contains interfaces for the PHPCR standard.
The JSR-283 specification defines an API for a Content Repository (CR). The PHP Content Repository Interfaces aims to provide that API in PHP. PHPCR is part of JSR-333, the next version of the Java Content Repository.
There is a bunch of information here: http://phpcr.github.io
Documentation
Introduction
PHP content repository is an API. That is, it defines a standardized way how to access and manipulate content. As with any general API, the main goal is to decouple the backend from the frontend. If you code against the PHPCR API, your code should run with all PHPCR implementations. David Nuescheler, the lead of JCR, provides the following advantages of using a content repository.
- Functional Definition of a “Content Repository”
- Common Vocabulary!
- No longer learn (dozens of) (ugly) proprietary APIs
- Write (mostly) portable code, for Document Management, Web Content Management, Source Code Control
- Compare Repository Functionality
- No more information silos and vendor Lock-in Content-Centric Infrastructure
PHPCR is adapted from the Java Content Repository (JCR) standard because that is a widely used and well thought through standard. There exist a couple of implementations for PHPCR that you can use. See below for a list of known implementations.
Further reading
Port Status
The PHPCR is following the Java Content Repository JCR API closely where appropriate. In the points where Java and PHP differ, we tried to follow the logic of PHP while keeping the spirit of the original API. The API has the same expressiveness as the Java API. Most of the JSR-283/JSR-333 documentation and code examples should be usable as-is.
Main differences between PHPCR and JCR are
- PHP has no method overloading. Same-name methods that differ only by parameter number and/or type have been merged into one method.
- PHP is weak typed, which makes the Value interface and the large number of almost-identical iterators obsolete.
An exhaustive list of the differences between PHPCR and JCR is in the file doc/JCR_TO_PHPCR.txt
Tests
Unit tests
As PHPCR is an API definition, there is not much to test on it without an implementation. Nonetheless, there are a few concrete classes that do have unit tests. Simply run them with phpunit -c tests/
API Tests
An API test suite for the functionality of PHPCR is available at https://github.com/phpcr/phpcr-api-tests/ All implementations have to test against this test suite to make sure they are interchangeable with each other.
Implementations
Jackalope separates the content repository logic from the storage backend. Several backend drivers are currently being developed.
- Jackalope-Jackrabbit: Mapping requests to a java Jackrabbit instance. To day the most feature complete implementation.
- Jackalope-DoctrineDBAL: Storing data in a relational database using the Doctrine Database Abstraction Layer.
The following are a work in progress:
- Jackalope-MongoDB: Storing data in a MongoDB database.
- Jackalope-Prismic: Storing data in the Prismic.io content repository as a service.
- Jackalope-Midgard1 (not online afaik): Read access to the midgard 1.0 server.
- Midgard2: PHPCR interfaces for the midgard2 content repository.
If you work on your own implementation, please let us know so we can add it here right away. Even if its not yet working, others might want to join in and help.
Utilities
- phpcr-utils: A couple of utility classes and console commands to work with phcpr, independent of the implementation.
- PHPCR Shell: The PHPCR Shell aims to provide a complete shell interface to any PHPCR repository.
- Marmelab PHPCR Browser: Angular JS based PHPCR repository browser. Currently only supports Jackalope-Jackrabbit and Jackalope-Doctrine-DBAL.
Dependencies
PHPCR provides a composer.json for Composer and is available through Packagist.
History
The API was originally ported from Java to PHP by Karsten Dambekalns with the help of others for the typo3/flow3 project.
A first attempt at a port of JSR-170 to php has been made by SimPCoRe, but it seems no applications have been published. That version never tried to provide an API, but just implemented the Java interfaces literally.
phpcr/phpcr 适用场景与选型建议
phpcr/phpcr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.33M 次下载、GitHub Stars 达 441, 最近一次更新时间为 2011 年 11 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpcr」 「contentrepository」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phpcr/phpcr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phpcr/phpcr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phpcr/phpcr 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Content Repository implementation independant utilities
Graphical analysis & visualizer for the Neos CMS nodetypes as backend module
This bundle provides tools to build persistence-agnostic storage layer.
PHP Content Repository compliance test suite
The bundle provides command to migrate the Sulu database from phpCr to the SuluContentBundle.
PHP Content Repository implementation using Midgard2
统计信息
- 总下载量: 3.33M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 443
- 点击次数: 31
- 依赖项目数: 16
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2011-11-01