forked from DennyLoko/dragon-quiz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
35 lines (28 loc) · 755 Bytes
/
Copy pathbootstrap.php
File metadata and controls
35 lines (28 loc) · 755 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
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Dotenv\Dotenv;
$dotenv = Dotenv::create(__DIR__);
$dotenv->load();
$isDevMode = true;
$proxyDir = null;
$cache = null;
$useSimpleAnnotationReader = false;
$config = Setup::createAnnotationMetadataConfiguration(
[__DIR__ . '/src/entity'],
$isDevMode,
$proxyDir,
$cache,
$useSimpleAnnotationReader
);
$conn = array(
'driver' => 'pdo_mysql',
'dbname' => getenv('MYSQL_DATA'),
'user' => getenv('MYSQL_USER'),
'password' => getenv('MYSQL_PASS'),
'host' => getenv('MYSQL_HOST'),
);
// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);