2017 © Pedro Peláez
 

library ZfPhpcrOdmSample

Zend Framework 2 Example Module that shows how ocramius/ZfPhpcrOdm works

image

ocramius/ZfPhpcrOdmSample

Zend Framework 2 Example Module that shows how ocramius/ZfPhpcrOdm works

  • Sunday, April 8, 2012
  • by Ocramius
  • Repository
  • 1 Watchers
  • 4 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

README

This is a sample Module demonstrating the ZfPhpcrOdm "Zend Framework 2 - Doctrine PHPCR-ODM bridge" functionality., (*1)

(VERY!) QUICK SETUP

Just do following:, (*2)

# clone pre-configured skeleton
git clone -b zf-phpcr-odm-sample git://github.com/Ocramius/ZendSkeletonApplication.git --recursive
# fetch and run jackrabbit service
./ZendSkeletonApplication/module/ZfPhpcrOdm/library/doctrine-phpcr-odm/lib/vendor/jackalope/tests/vendor/vendors_jackrabbit.sh
# then point a virtualhost's documentroot to ZendSkeletonApplication/public

Running Examples

Just visit, (*3)

  • http://your.vhost/document-manager/index to see if the Document Manager has been created correctly
  • http://your.vhost/document-manager/persist-greeting to save a new instance of ZfPhpcrOdmSample\Document\Greeting
  • http://your.vhost/document-manager/list-greetings to view the list of saved ZfPhpcrOdmSample\Document\Greeting

DETAILED SETUP (when you understand it)

Dependencies

  • This module uses ZfPhpcrOdm ( https://github.com/Ocramius/ZfPhpcrOdm ). You should already have installed ZfPhpcrOdm before continuing.
  • This module was built on the Zend Framework sample Application module ( https://github.com/zendframework/ZendSkeletonApplication/tree/master/modules/Application ). It should work without it, but some Mvc configuration would be required.

Setup

Following steps are necessary to get this project working (considering a zf2-skeleton or very similar application), (*4)

  1. cd path/to/my/zf2application
  2. git clone https://Ocramius@github.com/Ocramius/ZfPhpcrOdmSample.git modules/ZfPhpcrOdmSample
  3. open path/to/my/zf2application/config/application.config.php and add 'ZfPhpcrOdmSample' to your 'modules' configuration key (ensure it is placed after key 'ZfPhpcrOdm').
  4. adjust write permissions to allow php to write to following path:
    • path/to/my/zf2application/modules/ZfPhpcrOdmSample/src/ZfPhpcrOdmSample/Proxy

Configuration

A simple fresh instance of Jackrabbit running is enough to let this module run without configuration changes. It writes by default on workspace "default" and connects to localhost on port 8888 using simple authentication as user "admin" with password "admin". If you have set some password, or need to connect to a different host, just change the following module configurations:, (*5)

'zfphpcrodm-jackrabbittransport' => array(
    'parameters' => array(
        'serverUri' => 'http://your-host:1234/server/',
    ),
),
'zfphpcrodm-credentials' => array(
    'parameters' => array(
        'userID' => 'username',
        'password' => 'secret',
    ),
),

Tuning for production

  • TODO

The Versions

08/04 2012

dev-master

9999999-dev http://www.doctrine-project.org/

Zend Framework 2 Example Module that shows how ocramius/ZfPhpcrOdm works

  Sources   Download

The Requires

  • php >=5.3.3
  • ocramius/ocracomposer dev-master
  • ocramius/zfphpcrodm dev-master

 

zf2 doctrine module odm example phpcr