Weave Code
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 Utils Laravel Package

phpcr/phpcr-utils

Utility library for PHPCR (PHP Content Repository) implementations. Provides helper classes for sessions, node/paths handling, query utilities, and common repository operations to simplify working with PHPCR backends in your applications.

View on GitHub
Deep Wiki
Context7

Getting Started

This package provides utilities for working with PHPCR (PHP Content Repository) implementations like Jackalope or Doctrine PHPCR-ODM. Since it's a support library—not a standalone implementation—you must already be using a PHPCR-backed system (e.g., via doctrine/phpcr-odm or jackalope/jackalope). Start by installing the package with Composer:

composer require phpcr/phpcr-utils

Your first practical use case is likely running administrative or migration commands via its Symfony Console integration (e.g., phpcr:node:show, phpcr:workspace:export). These are especially helpful during development or content migration phases when inspecting the repository structure.

Implementation Patterns

  • CLI Utilities: Leverage its phpcr:node:export, phpcr:node:import, and phpcr:workspace:copy commands to script content scaffolding, backups, or staging syncs in devops pipelines.
  • Query Helpers: Use PHPCR\Util\QOM\QueryBuilder to construct QOM (Query Object Model) queries programmatically—safer and more maintainable than raw SQL2 strings.
  • Node Navigation: Use PHPCR\Util\NodeHelper to traverse parent/child relationships or locate nodes by relative paths (e.g., getNodeByPath()), simplifying code that manipulates deeply nested structures.
  • Console Commands: Extend or override existing commands (e.g., PHPCR\Util\Console\Command\NodeShowCommand) in your own application to add custom formatting or logging.

Gotchas and Tips

  • No Auto-Registration: Commands aren’t auto-registered—you must explicitly add them to your Console application’s command list, or integrate with Symfony’s RegisterCommandsPass.
  • PHPCR Session Dependency: All helpers assume a configured, active Session object. Ensure session configuration (e.g., backend, credentials, workspace) is correct before relying on utilities like NodeHelper::move().
  • Path Separator Differences: PHPCR uses / as path separator, but paths must be absolute and normalized. Watch out for trailing slashes and double slashes—NodeHelper::normalizePath() can help, but verify inputs.
  • Extensibility: This package is intentionally minimal. For richer features (e.g., content staging, versioning workflows), pair it with doctrine/phpcr-odm or build atop its core helpers rather than re-implementing.
  • Legacy Support: As of late 2020s, PHPCR usage has declined in favor of modern APIs (e.g., Doctrine DBAL-based solutions). Verify that PHPCR is still the right fit before onboarding new tooling—this package is stable but niche.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport