-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
28 lines (20 loc) · 950 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
<?php
define('DOCROOT', rtrim(dirname(__FILE__), '\\/'));
define('PATH_INFO', isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : NULL);
define('DOMAIN_PATH', dirname(rtrim($_SERVER['PHP_SELF'], PATH_INFO)));
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . DOMAIN_PATH, '\\/'));
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');
$output = renderer($renderer)->display(getCurrentPage());
cleanup_session_cookies();
echo $output;
exit;