Location: PHPKode > projects > MongoDB Object Document Mapper > tools/sandbox/config.php
<?php

require_once __DIR__ . '/../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';

use Doctrine\Common\ClassLoader,
    Doctrine\Common\Annotations\AnnotationReader,
    Doctrine\ODM\MongoDB\Configuration,
    Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver,
    Doctrine\ODM\MongoDB\Mongo,
    Doctrine\ODM\MongoDB\DocumentManager;

$classLoader = new ClassLoader('Doctrine\Common', __DIR__ . '/../../lib/vendor/doctrine-common/lib');
$classLoader->register();

$classLoader = new ClassLoader('Doctrine\ODM\MongoDB', __DIR__ . '/../../lib');
$classLoader->register();

$classLoader = new ClassLoader('Symfony', __DIR__ . '/../../lib/vendor');
$classLoader->register();

$classLoader = new ClassLoader('Documents', __DIR__);
$classLoader->register();

$config = new Configuration();

$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
$config->setDefaultDB('doctrine_odm_sandbox');

/*
$config->setLoggerCallable(function(array $log) {
    print_r($log);
});
$config->setMetadataCacheImpl(new ApcCache());
*/

$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\ODM\MongoDB\Mapping\\');
$config->setMetadataDriverImpl(new AnnotationDriver($reader, __DIR__ . '/Documents'));

$dm = DocumentManager::create(new Mongo(), $config);
Return current item: MongoDB Object Document Mapper