-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.php
More file actions
41 lines (31 loc) · 1.4 KB
/
index.php
File metadata and controls
41 lines (31 loc) · 1.4 KB
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
<?php
ini_set('display_errors', true);
//Initialize all settings and autoloaders
require_once(__DIR__ . "/init.php");
\SiteMaster\Core\User\Session::start();
// Initialize App, and construct everything
$app = new \SiteMaster\Core\Controller($_GET);
// Set a few caching options
$options = array(
'cacheDir' => \SiteMaster\Core\Config::get('CACHE_DIR'),
'lifeTime' => 60*60*24*7 //cache for 7 days
);
// Create a Cache_Lite object
$cache = new \Savvy_Turbo_CacheInterface_UNLCacheLite($options);
//Render Away
$savvy = new \SiteMaster\Core\OutputController($app->options);
$savvy->setCacheInterface($cache);
$savvy->setTheme(\SiteMaster\Core\Config::get('THEME'));
$savvy->initialize();
$savvy->addGlobal('app', $app);
$savvy->addGlobal('plugin_manager', \SiteMaster\Core\Plugin\PluginManager::getManager());
$savvy->addGlobal('user', \SiteMaster\Core\User\Session::getCurrentUser());
$savvy->addGlobal('grading_helper', new \SiteMaster\Core\Auditor\GradingHelper());
$savvy->addGlobal('base_url', \SiteMaster\Core\Util::getAbsoluteBaseURL());
$savvy->addGlobal('theme_helper', new \SiteMaster\Core\ThemeHelper());
$savvy->addGlobal('csrf_helper', \SiteMaster\Core\Controller::getCSRFHelper());
$savvy->addGlobal('scan', false);
if (isset($app->options['scans_id']) && $scan = \SiteMaster\Core\Auditor\Scan::getById($app->options['scans_id'])) {
$savvy->addGlobal('scan', $scan);
}
echo $savvy->render($app);