-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathindex.php
57 lines (43 loc) · 1.65 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
56
57
<?php
/**
Purpose: Where the story begins (Welcome to the Mth3l3m3nt Framework)
Copyright (c) 2015 ~ alienwithin
Munir Njiru <[email protected]>
@version 1.0.0
@date: 30.06.2015
@url : http://munir.skilledsoft.com
**/
// Kickstart the framework
$f3=require('lib/base.php');
//load the configuration
$f3->config('framework/configuration.php');
$f3->set('APP_VERSION', '1.2');
$f3->set('ESCAPE', TRUE);
$f3->set('PACKAGE', 'OWASP Mth3l3m3nt Framework');
//Check Writeable Directories and Files have the right permissions
if (!is_dir($f3->get('TEMP')) || !is_writable($f3->get('TEMP')))
$writeableErr[] = sprintf('please make sure that the \'%s\' directory is existing and writable.',$f3->get('TEMP'));
if (!is_writable('framework/data/'))
$writeableErr[] = sprintf('please make sure that the \'%s\' directory is writable.','framework/data/');
if (!is_writable('framework/data/site_config.json'))
$writeableErr[] = sprintf('please make sure that the \'%s\' file is writable.','framework/data/site_config.json');
//handles all pagination
\Template::instance()->extend('pagebrowser','\Pagination::renderTag');
\Template\FooForms::init();
if(isset($writeableErr)) {
header('Content-Type: text;');
die(implode("\n",$writeableErr));
}
//Initialize some F3 Settings
$f3->set('FLASH', Flash::instance());
$web= Web::instance();
//Database Setup From our Config Class Instance
$cfg = Config::instance();
$f3->set('CONFIG', $cfg);
if ($cfg->ACTIVE_DB)
$f3->set('DB', DBHandler::instance()->get($cfg->ACTIVE_DB));
else {
$f3->error(500,'Sorry, but there is no active DB setup.');
}
require('framework/paths.php');
$f3->run();