Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tools / sandbox / cli-config.php
1 <?php
2
3 require_once '../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
4
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();
17
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);
22
23 $config->setProxyDir(__DIR__ . '/Proxies');
24 $config->setProxyNamespace('Proxies');
25
26 $connectionOptions = array(
27     'driver' => 'pdo_sqlite',
28     'path' => 'database.sqlite'
29 );
30
31 $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
32
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)
36 ));