Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

142 lines (88 sloc) 4.591 kb

Symfony Content Management Framework Sandbox

This sandbox is a testing ground for the cmf bundles being developped.

It is based on the Symfony Standard edition and adds all cmf related bundles on top of the standard edition bundles.

Link to the live demo

Getting started

You can run the sandbox on your system, or in a virtualbox VM using Vagrant. For the latter, see "Getting started using Vagrant"

You will need:

  • Git 1.6+
  • PHP 5.3.2+
  • php5-intl
  • phpunit 3.5+ (optional)

Get the code

git clone git://github.com/symfony-cmf/cmf-sandbox.git
cd cmf-sandbox
# we skipped the web installer for now
# copy parameters template and edit as needed
cp app/config/parameters.yml.dist app/config/parameters.yml
bin/vendors install

This will fetch the main project and all it's dependencies ( Cmf Bundles, Symfony, Doctrine\PHPCR, Jackalope ... ) Please also adjust the app/config/parameters.yml as needed. Specifically pick the PHPCR backend and adjust the URL and database configurations accordingly.

Install and run Apache JackRabbit

Follow the guide in the Jackalope Wiki. You can also use a different PHPCR implementation but this is what is most tested.

Prepare the phpcr repository

Once your repository is set up, you need to register the node types for phpcr-odm:

app/console doctrine:phpcr:register-system-node-types

Next you need to create a workspace that will hold the data for the sandbox. The default parameters.yml defines the workspace to be 'sandbox'. You can change this of course. If you do, also adjust the following command.

app/console doctrine:phpcr:workspace:create sandbox

Import the fixtures

The admin backend is still in an early stage. Until it improves, the easiest is to programmatically create data. The best way to do that is with the doctrine data fixtures. The DoctrinePHPCRBundle included in the symfony-cmf repository provides a command to load fixtures.

app/console -v doctrine:phpcr:fixtures:load

Run this to load the fixtures from the Sandbox MainBundle.

Access by web browser

Create an apache virtual host entry along the lines of Servername cmf.lo DocumentRoot /path/to/symfony-cmf/cmf-sandbox/web AllowOverride All

And add an entry to your hosts file for cmf.lo

Then point your browser to http://cmf.lo/app_dev.php

Production environment

In order to run the sandbox in production mode at http://cmf.lo/ you need to generate the doctrine proxies:

app/console cache:warmup --env=prod --no-debug

Getting started using Vagrant

You will need:

  • Git 1.6+
  • Nfs (MacOS works OOB, on Debian based linux distributions install nfs-kernel-server package)
  • Vagrant

Get the code

git clone git://github.com/symfony-cmf/cmf-sandbox.git
cd cmf-sandbox
# we skipped the web installer for now
# copy parameters template and edit as needed
cp app/config/parameters.yml.dist app/config/parameters.yml
cd vagrant
vagrant up
vagrant ssh
bin/vendors install

This will fetch the main project and all it's dependencies ( Cmf Bundles, Symfony, Doctrine\PHPCR, Jackalope ... )

Jackrabbit

Afterwards you will need to manually register the system node types and import the fixtures as explained above.

Access by web browser

Optionally add an entry to your hosts file for cmf.lo pointing to 33.33.33.10, then point your browser to http://cmf.lo/app_dev.php Or go straight to http://33.33.33.10/app_dev.php

Other hints

Console

The PHPCR ODM Bundle provides a couple of useful commands in the doctrine:phpcr namespace. Type app/console to see them all.

Admin interface

There is a proof-of-concept admin interface using the SonataPhpcrAdminBundle at http://cmf.lo/app_dev.php/admin/dashboard

Basically you have paginated lists for two types of documents. You create new documents, edit and delete them. Some filtering is available in the list. This bundle is an implementation of Sonata Admin Bundle

At the moment there is no notion of parents and sons in the admin bundle.

Run the test suite

Tests are written with PHPUnit.

TESTS ARE CURRENTLY BROKEN

phpunit -c app
Jump to Line
Something went wrong with that request. Please try again.