-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
45 lines (34 loc) · 1.12 KB
/
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
36
37
38
39
40
41
42
43
44
45
<?php
require_once 'vendor/autoload.php';
// ArangoDB PHP Driver still uses PSR-0 autoloader, so we require this PSR-0 autoloader here
require_once 'vendor/triagens/arangodb/autoload.php';
use Silex\Application;
use App\Providers\ControllerServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use App\Providers\ArangoConnectionServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Symfony\Component\Yaml\Yaml;
$app = new Application();
$config = Yaml::parse(file_get_contents('app.yml'));
$app['config'] = $config;
$app['debug'] = $app['config']['application']['debug'];
/**
* Services
*/
/**
* Providers
*/
$app->register(new ServiceControllerServiceProvider());
$app->register(new ControllerServiceProvider());
$app->register(new ArangoConnectionServiceProvider());
$app->register(new TwigServiceProvider(), [
'twig.path' => 'views'
]);
// Home
$app->get('/', 'home:index');
$app->get('/create', 'home:getCreate');
$app->post('/store', 'home:postCreate');
$app->get('/edit/{id}', 'home:getUpdate');
$app->post('/update/{id}', 'home:postUpdate');
$app->post('/delete/{id}', 'home:delete');
return $app;