Merge branch 'dev' into live
[dylansserver.git] / controller.php
1 <?php
2
3 require_once("model/model.php");
4
5 abstract class cms {
6
7 public function __construct() {
8 $this->model = new model();
9 ob_start();
10 }
11
12 public static function init() {
13 if (isset($_GET['page']) && is_numeric($_GET['page'])) {
14 require_once("model/page.php");
15 $page = new page();
16 $page->display();
17 } else if (isset($_GET['year'])) {
18 require_once("model/archive.php");
19 $archive = new archive();
20 $archive->display();
21 } else if (isset($_GET['note'])) {
22 require_once("model/note.php");
23 $note = new note();
24 $note->display();
25 } else if ($_SERVER['REQUEST_URI'] == '/') {
26 require_once("model/index.php");
27 $index = new index();
28 $index->display();
29 } else if (isset($_GET['project'])) {
30 require_once("model/project.php");
31 $project = new project();
32 $project->display();
33 } else if (isset($_GET['rss'])) {
34 require_once("model/rss.php");
35 $rss = new rss();
36 $rss->display();
37 } else if (isset($_GET['challenge'])) {
38 require_once("model/captcha.php");
39 $captcha = new captcha();
40 $captcha->display();
41 }
42 }
43
44 }
45
46 class notFound extends Exception {
47
48 public function __construct() {
49 header('HTTP/1.0 404 Not Found');
50 ob_end_clean();
51 include('404.php');
52 exit();
53 }
54
55 }
56
57
58 ?>