-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
48 lines (35 loc) · 1.12 KB
/
Copy pathindex.php
File metadata and controls
48 lines (35 loc) · 1.12 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
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Created by PhpStorm.
* User: raph
* Date: 24/06/16
* Time: 17:02
*/
use Efrogg\Coverage\Provider\CoverageFrontProvider;
use Efrogg\Coverage\Renderer\CoverageTwigExtension;
use Efrogg\Db\Adapters\Pdo\PdoDbAdapter;
use PicORM\PicORM;
use Silex\Provider\ServiceControllerServiceProvider;
ini_set("display_errors","on");
$autoload = include_once 'vendor/autoload.php';
PicORM::configure(array(
'datasource' => new PDO("mysql:dbname=web;host=test_mysql", "root", "root")
));
$application = new Silex\Application();
\Efrogg\Coverage\Storage\StorageModel::setApp($application);
$application["debug"] = true;
$application["db"] = new PdoDbAdapter(PicORM::getDataSource());
$application["twig"] = function() {
$twig = new Twig_Environment(
new Twig_Loader_Filesystem("templates"),
array(
'debug' => true,
));
$twig->addExtension(new Twig_Extension_Debug());
$twig->addExtension(new CoverageTwigExtension());
return $twig;
};
$application->register(new ServiceControllerServiceProvider());
$application->mount("/", new CoverageFrontProvider());
$application->run();
exit;