1

I'am new to symfony, even more to symfony cmf. I have project idea and want to get started, but as I'am reading documentation I get more and more confused.

What I need to build is CMS with tree like structure routes and multilingual support for those routes. However I'm confused with this PHPCR stuff as it's new to me and I don't wan't to install java to my server, does that means, I can't use CMF?

I read of Doctrine ORM solution, but didn't find example, clear documentation and there's also 2 more concepts, I can't figure out:

  • doctrine / phpcr-odm
  • jackalope / jackalope-doctrine-dbal

How different they are or maybe they complement each other?

So to summrize the question: If someone could explain me PHPCR, PHPCR-ODM, doctrine-dbal, and tell me can I create CMS using CMF and only MySQL database (I saw note that it's possible load routes from DB) and how would one should approach this problem?

Wouter J
  • 41,455
  • 15
  • 107
  • 112
antanas_sepikas
  • 5,644
  • 4
  • 36
  • 67

1 Answers1

1

The PHPCR story is a bit different from what you know from other DB storage systems. That can cause confusion, so let me explain the concepts behind it.

The basic flow chart can be represented as this: basic flow chart

The Application layer is the PHP code that you have written. To put some data in PHPCR, you create a new node (which is like a row in a MySQL db) and inject that into the PHPCR layer. This layer communicates with a jackalope connection, which is bounded to the DB.

If you are using the Doctrine PHPCR-ODM, there is a new layer between the Application layer and the PHPCR layer. You will not use the PHPCR directly, you'll only use it through this Doctrine layer.

The Jackalope layer can have multiple different ways for different DB layers. By now, there are 2 options for the Jackalope layer: Jackrabbit or Doctrine DBAL.
Using the Jackrabbit option, you communicate through Jackalope with a JAVA Jackrabbit DB system. This is the most powerfull, feature-rich and properbly the quickest option.
You can also choose for using Doctrine DBAL. This Jackalope adapter will use the Doctrine DBAL layer to communicate with the DB. Doctrine DBAL can work with most of the relational databases (SQLite, MySQL, Oracle, etc.).

Almost all examples from the Symfony CMF use the Doctrine DBAL version, as it's easier to set-up if you are new into the PHPCR world. Just look at the documentation, sandbox or standard edition for examples.

Wouter J
  • 41,455
  • 15
  • 107
  • 112
  • So if I use Doctrine DBAL(jackalope-doctrine-dbal if I understood correctly), I don't need PHPCR, PHPCR-ODM, or anything else, and I can create my site using only php and mysql, with no java running in background what so ever? And second question I saw video - https://www.youtube.com/watch?v=i5Y5QPcYWHw of a system built with symfony cmf, and routes there we documents on the file system, so by using Doctrine DBAL, I can avoid this, and store my routes, inside DB? – antanas_sepikas Apr 04 '14 at 11:36
  • 1
    PHPCR is a set of *interfaces* that define how to interact with tree structured data. phpcr-odm is an object mapper on top of that so you can work with your domain objects instead of raw data. the cmf works with objects, and provides bindings for phpcr-odm. you could write your own objects for doctrine orm or any other object mapper - but the phpcr tree philosophy really goes well with cms systems. as phpcr is just interfaces, you need an implementation of phpcr. as wouter says, you can choose jackalope-doctrine-dbal which works with sql databases, or jackalope-jackrabbit which talks to java – dbu Apr 05 '14 at 09:07