-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap_doctrine.php
executable file
·32 lines (26 loc) · 1.03 KB
/
bootstrap_doctrine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
// bootstrap_doctrine.php
// See :doc:`Configuration <../reference/configuration>` for up to date autoloading details.
use Doctrine\ORM\Tools\Setup;
require_once "Doctrine/ORM/Tools/Setup.php";
Setup::registerAutoloadPEAR();
// Create a simple "default" Doctrine ORM configuration for XML Mapping
$isDevMode = true;
$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
// or if you prefer yaml or annotations
//$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/entities"), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
// database configuration parameters
$conn = array(
'driver' => 'pdo_sqlite',
'path' => __DIR__ . '/db.sqlite',
);
//$conn = array(
// 'dbname' => 'summercamp',
// 'user' => 'cihangir',
// 'password' => '123456',
// 'host' => '192.168.125.31',
// 'driver' => 'pdo_pgsql',
//);
// obtaining the entity manager
$entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);