forked from scummvm/scummvm-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
45 lines (39 loc) · 1.21 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
<?php
/* Load the configuration. */
require_once('include/config.inc.php');
/* Set up the include path. */
set_include_path(get_include_path() . PATH_SEPARATOR . DIR_INCLUDE);
error_reporting(E_ALL ^ E_NOTICE); // disable notices
if (!is_writeable(SMARTY_DIR_COMPILE)) {
print "Smarty compile dir (" . SMARTY_DIR_COMPILE . ") isn't writeable!<br>\n";
die (1);
}
/* Exception handling. */
require_once('ExceptionHandler.php');
set_exception_handler(array('ExceptionHandler', 'handleException'));
/* Page mapping. */
$pages = array(
'compatibility' => 'CompatibilityPage',
'contact' => 'ContactPage',
'credits' => 'CreditsPage',
'demos' => 'DemosPage',
'documentation' => 'DocumentationPage',
'downloads' => 'DownloadsPage',
'faq' => 'FAQPage',
'feeds' => 'FeedsPage',
'links' => 'LinksPage',
'news' => 'NewsPage',
'press' => 'PressPage',
'presssnowberry' => 'PressSnowberryPage',
'screenshots' => 'ScreenshotsPage',
'subprojects' => 'SubprojectsPage',
);
/* Default to the news page. */
if (!array_key_exists(($page = isset($_GET['p']) ? $_GET['p'] : null), $pages)) {
$page = 'news';
}
/* Switch to the requested page */
require_once ("Pages/{$pages[$page]}.php");
$p = new $pages[$page]();
return $p->index();
?>