forked from jdsimcoe/churchdeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·42 lines (27 loc) · 1.1 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
<?php
/*
CHURCHDEPLOY
============
Except the Lord build the house, they labour in vain that build it:
except the Lord keep the city, the watchman waketh but in vain.
- Psalms 127:1
*/
define('DOCROOT', rtrim(dirname(__FILE__), '\\/'));
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'));
require(DOCROOT . '/symphony/lib/boot/bundle.php');
function renderer($mode='frontend'){
if(!in_array($mode, array('frontend', 'administration'))){
throw new Exception('Invalid Symphony Renderer mode specified. Must be either "frontend" or "administration".');
}
require_once(CORE . "/class.{$mode}.php");
return ($mode == 'administration' ? Administration::instance() : Frontend::instance());
}
$renderer = (isset($_GET['mode']) && strtolower($_GET['mode']) == 'administration'
? 'administration'
: 'frontend');
header('Expires: Mon, 12 Dec 1982 06:14:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-control: public');
$output = renderer($renderer)->display(getCurrentPage());
echo $output;
exit;