-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
27 lines (21 loc) · 847 Bytes
/
bootstrap.php
File metadata and controls
27 lines (21 loc) · 847 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
<?php
// include the composer autoloader for autoloading packages
require_once(__DIR__ . '/vendor/autoload.php');
function getEntityManager() : \Doctrine\ORM\EntityManager
{
$entityManager = null;
if ($entityManager === null)
{
$paths = [
__DIR__ . '/module/Application/src/Entity',
__DIR__ . '/module/Tags/src/Entity',
];
$isDevMode = true;
$config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$configLocal = require_once __DIR__ .'/config/autoload/local.php';
$dbParams = $configLocal['doctrine']['connection']['orm_default']['params'];
$dbParams['driver'] = 'pdo_mysql';
$entityManager = \Doctrine\ORM\EntityManager::create($dbParams, $config);
}
return $entityManager;
}