Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (19 sloc) 0.876 kb
7c0c57c @beberlei Initial code
beberlei authored
1 <?php
2 // bootstrap_doctrine.php
3
4 // See :doc:`Configuration <../reference/configuration>` for up to date autoloading details.
5 use Doctrine\ORM\Tools\Setup;
6
7 require_once "Doctrine/ORM/Tools/Setup.php";
8 Setup::registerAutoloadPEAR();
9
10 // Create a simple "default" Doctrine ORM configuration for XML Mapping
11 $isDevMode = true;
12 $config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
13 // or if you prefer yaml or annotations
14 //$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/entities"), $isDevMode);
15 //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
16
17 // database configuration parameters
18 $conn = array(
19 'driver' => 'pdo_sqlite',
20 'path' => __DIR__ . '/db.sqlite',
21 );
22
23 // obtaining the entity manager
24 $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);
Something went wrong with that request. Please try again.