1
0
mirror of synced 2025-01-07 17:47:10 +03:00
doctrine2/tools/sandbox/config.php
2009-09-06 03:53:35 +00:00

29 lines
1.0 KiB
PHP

<?php
require '../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader();
$classLoader->setBasePath('Doctrine', realpath(__DIR__ . '/../../lib'));
$classLoader->setBasePath('Entities', __DIR__);
$config = new \Doctrine\ORM\Configuration;
$cache = new \Doctrine\Common\Cache\ApcCache;
// Use ArrayCache is APC is not available
// Warning without APC Doctrine will not perform as well
$cache = new \Doctrine\Common\Cache\ArrayCache;
$config->setMetadataCacheImpl($cache);
$config->setQueryCacheImpl($cache);
# EXAMPLE FOR YAML DRIVER
#$config->setMetadataDriverImpl(new \Doctrine\ORM\Mapping\Driver\YamlDriver(__DIR__ . '/yaml'));
# EXAMPLE FOR XML DRIVER
#$config->setMetadataDriverImpl(new \Doctrine\ORM\Mapping\Driver\XmlDriver(__DIR__ . '/xml'));
$eventManager = new \Doctrine\Common\EventManager();
$connectionOptions = array(
'driver' => 'pdo_sqlite',
'path' => 'database.sqlite'
);
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config, $eventManager);