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.
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.
phpcr:node:export, phpcr:node:import, and phpcr:workspace:copy commands to script content scaffolding, backups, or staging syncs in devops pipelines.PHPCR\Util\QOM\QueryBuilder to construct QOM (Query Object Model) queries programmatically—safer and more maintainable than raw SQL2 strings.PHPCR\Util\NodeHelper to traverse parent/child relationships or locate nodes by relative paths (e.g., getNodeByPath()), simplifying code that manipulates deeply nested structures.PHPCR\Util\Console\Command\NodeShowCommand) in your own application to add custom formatting or logging.RegisterCommandsPass.Session object. Ensure session configuration (e.g., backend, credentials, workspace) is correct before relying on utilities like NodeHelper::move()./ 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.doctrine/phpcr-odm or build atop its core helpers rather than re-implementing.How can I help you explore Laravel packages today?