3 require_once '../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
5 $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', realpath(__DIR__ . '/../../lib'));
6 $classLoader->register();
7 $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib'));
8 $classLoader->register();
9 $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib'));
10 $classLoader->register();
11 $classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor'));
12 $classLoader->register();
13 $classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
14 $classLoader->register();
15 $classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
16 $classLoader->register();
18 $config = new \Doctrine\ORM\Configuration();
19 $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
20 $driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
21 $config->setMetadataDriverImpl($driverImpl);
23 $config->setProxyDir(__DIR__ . '/Proxies');
24 $config->setProxyNamespace('Proxies');
26 $connectionOptions = array(
27 'driver' => 'pdo_sqlite',
28 'path' => 'database.sqlite'
31 $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
33 $helpers = new Symfony\Component\Console\Helper\HelperSet(array(
34 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
35 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)