-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
33 lines (28 loc) · 894 Bytes
/
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
<?php
define('START_TIME', microtime(true));
define('DS', DIRECTORY_SEPARATOR);
define('EXT', ".php");
define('DEBUG', false);
define('BASE', __DIR__ . DS);
require 'core'.DS.'HandlerClass'.EXT;
$HandlerClass = new HandlerClass();
require BASE.'configuration'.DS.'Database'.EXT;
if (empty($_GET['p'])) {
$_GET['p'] = $HandlerClass->_class['ParserClass']->getindex();
}
if (!file_exists("content/" . $_GET['p'] . EXT) || !preg_match('#^[a-zA-Z0-9]+$#', $_GET['p'])) {
$_GET['p'] = $HandlerClass->_class['ParserClass']->geterreur();
}
ob_start();
require "content".DS. $_GET["p"] . EXT;
$content = ob_get_contents();
ob_end_clean();
include'template' . DS . 'layout.php';
if (DEBUG) {
$temps = function() {
echo '<br/>';
echo 'Page géneree en ' . round(microtime(true) - START_TIME, 5) . ' secondes';
};
$temps();
}
?>