forked from jbogdani/BraDyCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·56 lines (45 loc) · 1.16 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
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @author Julian Bogdani <[email protected]>
* @copyright BraDyUS. Communicating Cultural Heritage, http://bradypus.net 2007-2013
* @license MIT, See LICENSE file
* @since Dec 1, 2012
*/
try
{
require_once 'lib/globals.inc';
if (defined('CREATE_SITE'))
{
header('location: ./admin');
}
$outHtml = new OutHtml($_GET, $_SESSION['lang']);
$settings = unserialize(CACHE);
$settings['autoescape'] = false;
$twig = new Twig_Environment(new Twig_Loader_Filesystem('./sites/default'), $settings);
if ($_SESSION['debug'])
{
$twig->addExtension(new Twig_Extension_Debug());
}
$function = new Twig_SimpleFunction('file_exists', function ($file) {
return file_exists($file);
});
$twig->addFunction($function);
$filter = new Twig_SimpleFilter('parseTags', function ($string)
{
return customTags::parseContent($string);
});
$twig->addFilter($filter);
echo $twig->render('index.twig', array(
'html'=>$outHtml
));
}
catch (Exception $e)
{
header('Content-Type: text/html; charset=utf-8');
if ($_SESSION['debug'])
{
var_dump($e);
}
echo tr::get('error_check_log');
error_log($e->getMessage());
}