-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (27 loc) · 778 Bytes
/
Copy pathindex.php
File metadata and controls
36 lines (27 loc) · 778 Bytes
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
<?php
// perform some config that is not part of F3
require('app/base_config.php');
$f3=require('lib/base.php');
$f3->set('DEBUG',3);
$f3->set('UI','ui/');
/* setup common DB connection */
$db_clans = new \DB\SQL(
'mysql:host=localhost;dbname=fafclans',
'root',
''
);
$f3->set('DB_CLANS', $db_clans);
// "normal" routes
$f3->route('GET /logout',
function( $f3 ) {
$f3->clear( 'SESSION' );
$f3->reroute( 'http://' . $f3->get('HOST').'/'.$f3->get('BASE') );
}
);
// RESTful application controllers
$f3->map('/','App\Home');
$f3->route('GET /clan_@clanid','App\Clan->get');
$f3->route('GET /vote_@voteid','App\Vote->get');
$f3->map('/component/@controller','App\component\@controller');
$f3->map('/@controller','App\@controller');
$f3->run();