-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbootstrap.php
More file actions
38 lines (30 loc) · 739 Bytes
/
bootstrap.php
File metadata and controls
38 lines (30 loc) · 739 Bytes
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
36
37
38
<?php
# bootstrap.php
require_once join(DIRECTORY_SEPARATOR, [__DIR__, 'vendor', 'autoload.php']);
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
$entitiesPath = [
join(DIRECTORY_SEPARATOR, [__DIR__, "src"])
];
$isDevMode = true;
$proxyDir = null;
$cache = null;
$useSimpleAnnotationReader = false;
// Connexion à la base de données
$dbParams = [
'driver' => 'pdo_mysql',
'host' => 'localhost',
'charset' => 'utf8',
'user' => 'root',
'password' => '',
'dbname' => 'tvdb',
];
$config = Setup::createAnnotationMetadataConfiguration(
$entitiesPath,
$isDevMode,
$proxyDir,
$cache,
$useSimpleAnnotationReader
);
$entityManager = EntityManager::create($dbParams, $config);
return $entityManager;