X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftools%2Fsandbox%2Fcli-config.php;fp=vendor%2Fdoctrine%2Form%2Ftools%2Fsandbox%2Fcli-config.php;h=2a34fd89bf422c1ac84121d339cc5f351ea28d14;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/orm/tools/sandbox/cli-config.php b/vendor/doctrine/orm/tools/sandbox/cli-config.php new file mode 100644 index 0000000..2a34fd8 --- /dev/null +++ b/vendor/doctrine/orm/tools/sandbox/cli-config.php @@ -0,0 +1,36 @@ +register(); +$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib')); +$classLoader->register(); +$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib')); +$classLoader->register(); +$classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor')); +$classLoader->register(); +$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__); +$classLoader->register(); +$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__); +$classLoader->register(); + +$config = new \Doctrine\ORM\Configuration(); +$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); +$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); +$config->setMetadataDriverImpl($driverImpl); + +$config->setProxyDir(__DIR__ . '/Proxies'); +$config->setProxyNamespace('Proxies'); + +$connectionOptions = array( + 'driver' => 'pdo_sqlite', + 'path' => 'database.sqlite' +); + +$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); + +$helpers = new Symfony\Component\Console\Helper\HelperSet(array( + 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), + 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) +)); \ No newline at end of file