Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 1.401 kB
<?php
/**
* The config file is responsible to make class loading work and initialize a
* DocumentManagerHelper that contains the doctrine document manager with a
* Session of your phcpr implementation.
* The array $extraCommands can be used to inject implementation specific commands.
* Add instances of commands for eventual implementation specific commands to this array.
*/
$extraCommands = array();
$params = array(
'midgard2.configuration.db.type' => 'MySQL',
'midgard2.configuration.db.name' => 'midgard2_test',
'midgard2.configuration.db.host' => '0.0.0.0',
'midgard2.configuration.db.port' => 3306,
'midgard2.configuration.db.username' => '',
'midgard2.configuration.db.password' => '',
'midgard2.configuration.db.init' => true,
'midgard2.configuration.blobdir' => '/tmp/blobs'
);
$workspace = '';
$user = 'admin';
$pass = 'password';
$repository = \Midgard\PHPCR\RepositoryFactory::getRepository($params);
$credentials = new \PHPCR\SimpleCredentials($user, $pass);
$session = $repository->login($credentials, $workspace);
/* prepare the doctrine configuration */
$config = new \Doctrine\ODM\PHPCR\Configuration();
$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm)
));
Jump to Line
Something went wrong with that request. Please try again.