2009-08-31 20:21:29 +04:00
|
|
|
<?php
|
2009-09-11 23:50:48 +04:00
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
require_once __DIR__ . '/../../lib/Doctrine/Common/ClassLoader.php';
|
2009-09-11 23:50:48 +04:00
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
|
2009-09-11 23:50:48 +04:00
|
|
|
$classLoader->register();
|
2009-08-31 20:21:29 +04:00
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
|
2009-10-15 00:18:36 +04:00
|
|
|
$classLoader->register();
|
|
|
|
|
2009-08-31 20:21:29 +04:00
|
|
|
$config = new \Doctrine\ORM\Configuration();
|
|
|
|
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
|
2010-04-12 23:56:55 +04:00
|
|
|
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
|
|
|
|
$config->setMetadataDriverImpl($driverImpl);
|
|
|
|
|
2009-10-15 00:18:36 +04:00
|
|
|
$config->setProxyDir(__DIR__ . '/Proxies');
|
|
|
|
$config->setProxyNamespace('Proxies');
|
2009-09-11 23:50:48 +04:00
|
|
|
|
2009-08-31 20:21:29 +04:00
|
|
|
$connectionOptions = array(
|
2009-10-09 21:51:06 +04:00
|
|
|
'driver' => 'pdo_sqlite',
|
|
|
|
'path' => 'database.sqlite'
|
2009-08-31 20:21:29 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
|
2009-10-30 03:15:53 +03:00
|
|
|
|
2010-04-16 21:23:07 +04:00
|
|
|
$helpers = array(
|
2010-04-08 07:47:42 +04:00
|
|
|
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
|
|
|
|
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
|
2010-04-16 21:23:07 +04:00
|
|
|
);
|