-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
35 lines (26 loc) · 950 Bytes
/
bootstrap.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
33
34
35
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
ini_set('display_errors', 'on');
error_reporting(E_ALL);
// Create a simple "default" Doctrine ORM configuration for Annotations
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src/Entity"), $isDevMode);
// or if you prefer yaml or XML
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
// database configuration parameters
$conn = array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'dbname' => 'silex_test',
'user' => 'root',
'password' => 'root',
);
//$conn = array(
// 'driver' => 'pdo_sqlite',
// 'path' => __DIR__ . '/db.sqlite',
//);
// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);