Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpcr Odm Laravel Package

doctrine/phpcr-odm

Doctrine PHPCR ODM maps PHP objects to a PHPCR content repository, bringing Doctrine-style object-document mapping, unit of work, and repositories to PHP content management systems. It supports hierarchical, versioned content storage and integrates with Jackrabbit and Doctrine DBAL implementations.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a Doctrine-style object-document mapper, not an Eloquent-compatible ORM. It brings a DocumentManager with a Unit of Work, identity map, metadata drivers (attributes/XML/YAML), repositories, and a query builder over PHPCR-QOM. That pattern set is genuinely valuable if our domain is tree-shaped content — page trees, category hierarchies, asset folders, translated content nodes, versioned drafts. It buys us subtree traversal, node moves, references, and versioning semantics that we would otherwise hand-roll on top of adjacency lists or materialized paths. It is a poor fit for our mainstream CRUD/transactional domains: we would be swapping a framework-native, well-understood persistence layer for a standards-aligned one with a much smaller PHP ecosystem. The decision should be framed as "adopt a second persistence paradigm for one bounded content domain," not "change our data layer."

Integration feasibility. Mechanically installable via Composer and framework-agnostic at the library level, but it expects container-managed wiring: a Configuration object, metadata driver registration, a PSR-6 cache, an event manager, and — critically — a concrete phpcr/phpcr-implementation (Jackalope + Jackrabbit, or Jackalope + Doctrine DBAL). There is no first-party Laravel package; the documented integration path is the Symfony bundle in the Doctrine ecosystem, so we own a service-provider shim plus config publishing, health checks, and lifecycle wiring. The backend adds real footprint: Jackrabbit means a JVM service to operate; DBAL means a SQL schema we must provision and migrate. Feasible in a spike, but it is integration work, not a composer require.

Technical risk. High on ecosystem, moderate on code. 181 stars and zero downstream dependents means no community safety net, no third-party tutorials and integrations, and thin hiring supply. The project is maintained and current (2.x line tracking Symfony 7/8, PHP 8.5; 3.0.0 landing Doctrine Persistence 4), which argues against "abandoned," but the recent history is a steady stream of BC breaks: annotations removed for attributes, Doctrine Cache replaced by PSR-6, Collection → array in DocumentManagerInterface, query Expression classes relocated, DocumentManager::merge() removed, and a behavioral change where flush() no longer saves the PHPCR session absent ODM-level changes. Every one of those is upgrade work we would absorb. Secondary risks: a single implementation to bet on per deployment (Jackalope), and a semantic gap between PHPCR/JCR concepts and what a Laravel team intuitively expects.

Key questions.

  • Is the target domain materially hierarchical and content-shaped, with versioning/workspace needs, or are we pattern-matching on "categories have parents"?
  • Is there an existing JCR/Jackrabbit repository or a procurement requirement forcing standards-based content storage? If not, the option value shrinks considerably.
  • Who operates the backend — Jackrabbit (JVM ops, clustering, backup) or DBAL (SQL schema ownership, migrations)? That team must exist before we commit.
  • What is the expected content volume and read/write mix, and does the chosen backend's scaling story match it?
  • Do we have (or will we fund) Doctrine-fluent engineers, and is the ramp-up acceptable against the feature timeline?
  • What is the exit cost? Can we hide PHPCR entirely behind a content-repository port so a future swap is contained?
  • Which major version do we pin, and who owns the recurring upgrade line item in the platform-support matrix?

Integration Approach

Stack fit. Treat this as a bounded content service inside the Laravel app, not as a general persistence replacement. Isolation is the design principle: define an internal content-repository interface (page tree, taxonomy, asset folder operations) whose only implementation is PHPCR-backed. Application code depends on the port; only a thin adapter touches DocumentManager, Node, Path, and HierarchyInterface. This keeps Eloquent as the default for everything else and caps the blast radius if the package is later dropped. Register Configuration/DocumentManager in a dedicated service provider with a singleton lifecycle, bind PSR-6 cache to our existing cache store, and expose a health endpoint that verifies repository connectivity.

Migration path. Prefer greenfield: a new domain (e.g., CMS page tree, product taxonomy, document library) with no incumbent tables. Where content already lives in MySQL or is API-sourced, sequence as: (1) agree the content model and node-type/metadata mapping in a design doc; (2) build a read-only adapter and prove subtree queries and reads; (3) add writes behind a feature flag with a one-way export script from the legacy store as the initial load; (4) cut over reads, then writes, keeping legacy tables frozen for a rollback window. Do not attempt dual-write across two persistence paradigms — the consistency and reconciliation cost is where these projects typically fail. For any existing Jackrabbit/JCR deployment the path is inverted and much cheaper: the repository already exists and we are only adding a PHP read/write client.

Compatibility. Confirm the runtime matrix before anything: PHP 8.1+ (2.0 dropped 7.4), Symfony components 5.4–8 as a transitive dependency, PSR-6 caching, and — if we take the 3.0 line — Doctrine Persistence 4, which is a hard coupling point to our wider Doctrine-adjacent packages. Pin the major version explicitly and record it in the platform-support matrix. Verify the chosen PHPCR implementation's maintenance state and its own dependency floor; that is the component most likely to strand us on an old PHP.

Sequencing.

  1. Spike (1–2 weeks): stand up Jackalope + Doctrine DBAL locally, map one representative document with attributes, exercise subtree query, move, reference, and versioning. Output a go/no-go with measured effort.
  2. ADR: document the buy-vs-build decision against Postgres/MySQL + a tree library, including the Doctrine-paradigm cost.
  3. Port + adapter: define the repository interface; implement the PHPCR adapter; wire the service provider, config, health check.
  4. Pilot one bounded domain read-only in production behind a flag.
  5. Enable writes for the pilot with legacy frozen; measure latency and memory on realistic tree sizes.
  6. Expand only after the pilot proves the operational story (backups, restore, failure handling) is owned by a named team.

Operational Impact

Maintenance. This is a recurring cost line, not a one-time dependency add. Budget for tracking 2.x point releases (they arrive steadily, with Symfony/PHP compatibility churn) plus planned migrations at 3.0-style BC breaks — annotation removal, cache abstraction swaps, interface signature changes, query-class relocations. The upgrade surface is narrow if we keep PHPCR behind the port, but it is nonzero and should be owned by a named engineer, not absorbed ad hoc. Add a scheduled dependency-review task and an annual upgrade-window estimate to the roadmap.

Support. No vendor, no commercial backing, effectively no downstream community to lean on for answers. Support is self-support: our engineers read Doctrine documentation and PHPCR/JCR specifications, and debug into Jackalope when things go wrong. That is acceptable for a bounded, well-tested content domain; it is unacceptable for anything on the critical path to revenue with tight SLAs. Identify an internal owner with Doctrine depth before committing, and treat the absence of that person as a blocking risk.

Scaling. Entirely backend-dependent and must be stated plainly to stakeholders. DBAL-backed PHPCR keeps us in SQL, so scaling follows our existing database playbook (indexing, read replicas, partitioning) but with a schema we did not design and cannot tune freely. Jackrabbit scales well for content workloads but introduces a JVM service with its own clustering, backup, and upgrade lifecycle — a new operational discipline for a PHP team. Neither path removes the ODM's own costs: the identity map holds every document loaded in a unit of work, so long-running jobs that walk large trees need chunking and explicit clear(). Depth and breadth of subtree queries should be benchmarked with production-shaped data, not toy fixtures.

Failure modes.

  • Silent no-op flush. Since 2.0, flush() does not save the PHPCR session when there are no ODM-level changes. Code that relied on flush as a save-everything hammer will appear to work and quietly not persist. Audit for this pattern in review.
  • Backend unavailability. Jackrabbit down or DBAL connection loss surfaces as exceptions mid-unit-of-work; we need retry/queue strategy and a degraded read path, since the content model has no Eloquent fallback.
  • Identity-map memory growth in batch/import/export jobs walking large subtrees.
  • Cache misconfiguration (PSR-6 wiring) producing stale metadata or silent performance collapse.
  • Node/type schema drift — changes to document mapping that require repository-level node-type updates are not covered by a typical Laravel migration flow.
  • Upgrade breakage at BC boundaries manifesting as runtime errors in query expressions or collection handling, usually discovered late because coverage of PHPCR paths is thin.
  • Bus-factor — one internal expert, one upstream maintainer, no ecosystem.

Ramp-up. Two stacked learning curves: Doctrine patterns (Unit of Work, identity map, metadata mapping, lifecycle events) and PHPCR/JCR vocabulary (Node, Path, HierarchyInterface, workspace, node types). A Laravel developer strong in Eloquent should be assumed at roughly 3–6 weeks to productive on the adapter and 2–3 months to independently safe on schema changes and upgrades — with a Doctrine-fluent mentor compressing that materially. Onboarding friction is real and should be counted in the hiring and team-rotation plan: this is a specialized skill in a small market, so knowledge must be documented internally (ADR, runbook, mapping reference) rather than assumed to be searchable.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections