14.06.2013 Views

The Symfony CMF Book

The Symfony CMF Book

The Symfony CMF Book

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Listing 8-1<br />

Listing 8-2<br />

Listing 8-3<br />

Installation<br />

Choosing a Content Repository<br />

<strong>The</strong> first thing to decide is what content repository to use. A content repository is essentially a database<br />

that will be responsible for storing all the content you want to persist. It provides an API that is optimized<br />

for the needs of a CMS (tree structures, references, versioning, full text search etc.). While every content<br />

repository can have very different requirements and performance characteristics, the API is the same for<br />

all of them.<br />

Furthermore, since the API defines an export/import format, you can always switch to a different content<br />

repository implementation later on.<br />

<strong>The</strong>se are the available choices:<br />

• Jackalope with Jackrabbit (Jackrabbit requires Java, it can persist into the file system, a<br />

database etc.)<br />

• Jackalope with Doctrine DBAL (requires an RDBMS like MySQL, PostgreSQL or SQLite)<br />

• Midgard (requires the midgard2 PHP extension and an RDBMS like MySQL, PostgreSQL or<br />

SQLite)<br />

<strong>The</strong> following documentation includes examples for all of the above options.<br />

If you are just getting started with the <strong>CMF</strong>, it is best to choose a content repository based on a<br />

storage engine that you are already familiar with. For example, Jackalope with Doctrine DBAL<br />

will work with your existing RDBMS and does not require you to install Java or the midgard2 PHP<br />

extension. Once you have a working application it should be easy to switch to another option.<br />

Download the Bundles<br />

Add the following to your composer.json file, depending on your chosen content repository.<br />

Jackalope with Jackrabbit<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

"minimum-stability": "dev",<br />

"require": {<br />

...<br />

"jackalope/jackalope-jackrabbit": "1.0.*",<br />

"doctrine/phpcr-bundle": "1.0.*",<br />

"doctrine/phpcr-odm": "1.0.*"<br />

}<br />

Jackalope with Doctrine DBAL<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

"minimum-stability": "dev",<br />

"require": {<br />

...<br />

"jackalope/jackalope-doctrine-dbal": "dev-master",<br />

"doctrine/phpcr-bundle": "1.0.*",<br />

"doctrine/phpcr-odm": "1.0.*"<br />

}<br />

Midgard<br />

PDF brought to you by<br />

generated on June 13, 2013<br />

Chapter 8: Installing and Configuring Doctrine PHPCR-ODM | 32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!