This repository was archived by the owner on Jul 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.php
More file actions
49 lines (43 loc) · 1.34 KB
/
Copy pathindex.php
File metadata and controls
49 lines (43 loc) · 1.34 KB
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
<?php
if (php_sapi_name() == "cli-server") {
// running under built-in server
$extensions = array("php", "jpg", "jpeg", "css", "js");
$path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$ext = pathinfo($path, PATHINFO_EXTENSION);
if (in_array($ext, $extensions)) {
return false;
}
}
try {
/**
* Loading system
*/
require_once 'include/php/default.inc.php';
if(defined('INSTALLER_ENABLED')){
/**
* Load installer
*/
$content = Router::loadAndBufferOutput('installer/index.php');
}
else {
/**
* Handle request
*/
$content = Router::executeCurrentRequest();
}
}
catch(DatabaseException $e){
$content = '<div class="notification notification-fail">Faulty database query: "'.$e->getQuery().'".</div>';
}
catch(Exception $e){
$content = '<div class="notification notification-fail">'.$e->getMessage().'</div>';
}
if(defined('USING_OLD_CONFIG')){
$content = '<div class="notification notification-fail"><strong>Your WebMUM installation is still using the old deprecated config style!</strong><br><br>Please update your config to the new style (an example config can be found in <cite>config.php.example</cite>)<br>and delete your old <cite>config.inc.php</cite> and <cite>config.inc.php.example</cite>.</div>'.$content;
}
echo Router::loadAndBufferOutput(
'include/php/template/layout.php',
array(
'content' => $content,
)
);