-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.php
35 lines (27 loc) · 874 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
/**
* Created by PhpStorm.
* User: faizan
* Date: 13/1/18
* Time: 4:42 PM.
*/
use Doctrine\ORM\ORMException;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;
require_once 'vendor/autoload.php';
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration([__DIR__.'/src/Entity'], $isDevMode, null, null, false);
$dbParams = Yaml::parseFile(__DIR__.'/config/db.yaml');
try {
/** @var EntityManager $em */
$em = EntityManager::create($dbParams, $config);
} catch (ORMException $e) {
echo json_encode($e->getMessage());
}
$twigLoader = new Twig_Loader_Filesystem(__DIR__.'/src/templates');
$twig = new Twig_Environment($twigLoader);
/** @var Request $request */
$request = Request::createFromGlobals();
$report = new Api\Report($em, $twig);