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

Jackalope Doctrine Dbal Laravel Package

jackalope/jackalope-doctrine-dbal

Doctrine DBAL-based Jackalope backend for PHPCR, enabling content repository storage on SQL databases. Provides a DBAL transport layer, schema management, and integration pieces for running Jackalope with Doctrine DBAL across multiple database platforms.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by installing the package via Composer: composer require jackalope/jackalope-doctrine-dbal. Next, configure Doctrine DBAL (e.g., via config/packages/doctrine.yaml) with your DB connection (MySQL, PostgreSQL, etc.). Instantiate the PHPCR Repository using Jackalope\Repository and wire it with Jackalope\Transport\DoctrineDBAL\Transport — passing your DBAL Connection instance. For rapid prototyping, use phpcr:init and phpcr:registerNodeType commands (if using CMF/CR stack) or manually create the database schema via jackalope:dbal:ensure-db-is-ready (assuming symfony-cmf/console is installed). The first use case is typically storing and retrieving hierarchical content (e.g., pages or assets) with PHPCR’s getNode(), createNode(), and setProperty() methods.

Implementation Patterns

  • Repository Instantiation: Centralize PHPCR setup in a service (e.g., PhpcrSessionFactory) and inject it via constructor. Use Doctrine’s EntityManager alongside DBAL connection for mixed ORM/PHPCR workflows.
  • Node Versioning & Querying: Enable PHPCR versioning via phpcr:version:initialize (or programmatic initializeVersioning) and use QueryManager::createQuery() with SQL2/JCR-QOM to filter nodes by path, properties, or hierarchy.
  • Integration with Doctrine ORM: Keep PHPCR for content semantics (e.g., trees, versioning, i18n), and Doctrine ORM for structured business data. Link entities via foreign keys (e.g., Post::phpcrPath → PHPCR node), using lifecycle callbacks to sync state.
  • Batch Operations: Leverage Session::save() with transactional semantics for bulk node creation or update (avoid calling save() per node).
  • Testing: Use a dedicated sqlite DBAL connection for tests; configure in-memory DB and run jackalope:dbal:schema:dump before each test.

Gotchas and Tips

  • Schema Updates: The package does not auto-migrate schema on DBAL connection changes. Use jackalope:dbal:schema:dump (or jackalope:dbal:ensure-db-is-ready) after version upgrades to regenerate tables — check var/phPCR_schema.sql if issues arise.
  • Case Sensitivity: DBAL layer respects RDBMS case rules (e.g., PostgreSQL folds unquoted identifiers to lowercase). Use lowercase node/property names or explicitly quote in custom PHPCR queries.
  • Performance: Avoid getNodeByPath() in tight loops — it’s less efficient than getNode() when you already have UUIDs. Prefer PHPCR’s getNodeByIdentifier() for known nodes.
  • Transaction Isolation: PHPCR sessions do not auto-commit with DBAL transactions — wrap save() in explicit DBAL transaction ($connection->beginTransaction()) if atomicity across DBAL and PHPCR is required.
  • Extensibility: Override Transport or NodeRepository classes via DI to inject logging, monitoring, or custom event listeners — look for Transport’s doGetNodes() and doExecuteQuery() extension points.
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