forked from tsugiproject/tsugi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsugi.php
41 lines (32 loc) · 859 Bytes
/
tsugi.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
<?php
use Tsugi\Controllers\Login;
use Tsugi\Controllers\Logout;
use Tsugi\Controllers\Map;
use Tsugi\Controllers\Profile;
use Tsugi\Core\LTIX;
use Tsugi\Lumen\Application;
define('COOKIE_SESSION', true);
require_once('config.php');
// Make PHP paths pretty .../install => install.php
$router = new Tsugi\Util\FileRouter();
$file = $router->fileCheck();
if ( $file ) {
require_once($file);
return;
}
$launch = LTIX::session_start();
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
dirname(__DIR__)
))->bootstrap();
$app = new Application($launch);
$app['tsugi']->output->buffer = false;
// Hook up the Koseu and Tsugi tools
$app->router->group([
'namespace' => 'Tsugi\Controllers'
], function () use ($app) {
Login::routes($app);
Logout::routes($app);
Profile::routes($app);
Map::routes($app);
});
$app->run();