-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
55 lines (40 loc) · 1.43 KB
/
index.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
46
47
48
49
50
51
52
53
54
55
<?php
session_start();
// Initialise framework
$f3=require('lib/base.php');
$f3->set('DEBUG',1);
$f3->set('AUTOLOAD','app/controllers/');
$f3->set('APPROOT','/digicap');
// Set dev mode
$f3->set('DEV',1);
// Connection to database
$f3->set('DB', new DB\SQL(
'mysql:host=localhost;port=3306;dbname=digicap',
'root',
''
));
// Using SQL sessions
new \DB\SQL\Session( $f3->get('DB') );
// Routes
$f3->route('GET /',
function($f3) {
echo Template::instance()->render('app/views/mainfilter.php');
}
);
// Auth links
$f3->route('GET /login', 'MyAuth->showlogin'); // Show login page
$f3->route('POST /login', 'MyAuth->attemptlogin'); // Attempt to login
$f3->route('GET /logout', 'MyAuth->logout'); // Log the user out
// Content links
$f3->route('GET /search/@tags', 'ContentPool->search'); // Searching for content
$f3->route('GET /loadlo/@label', 'ContentPool->load'); // Loading a single Learning Object
// Authoring areas
$f3->route('GET /author', 'Author->listing'); // List the available content
$f3->route('GET /loadlist/@author', 'Author->loadList');// Loading list for chosen author
$f3->route('GET /addnew', 'Author->addNew'); // Loading list for chosen author
$f3->route('POST /buildlo', 'Author->buildNew'); // Process form submission to build the learning object
// Dev calls
// TODO: remove before shipping
$f3->route('GET /purge', 'DevTools->purge'); // Wipe non-essential data for fresh restart
$f3->run();
?>