-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.php
More file actions
33 lines (28 loc) · 1.05 KB
/
bootstrap.php
File metadata and controls
33 lines (28 loc) · 1.05 KB
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
<?php
if (!session_id()) @session_start();
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Tools\DsnParser;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\ORMSetup;
require_once "vendor/autoload.php";
require_once __DIR__ . '/TwigSingleton.php';
// Create a simple "default" Doctrine ORM configuration for Attributes
$config = ORMSetup::createAttributeMetadataConfiguration(
paths: array(__DIR__."/src/"),
isDevMode: true,
);
$dsnParser = new DsnParser();
$connectionParams = $dsnParser
->parse('mysqli://root:bibliotek@mysql:3306/bibliotek');
$connection = DriverManager::getConnection($connectionParams);
// obtaining the entity manager
global $entityManager;
$entityManager = new EntityManager($connection, $config);
// Get the Twig instance
global $twig;
$twig = TwigSingleton::getInstance();
global $msg;
$msg = new \Plasticbrain\FlashMessages\FlashMessages();
// Set HTML properties according to Tabler template
$msg->setCloseBtn('<a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>');
$msg->setMsgCssClass('alert alert-dismissible');