예제 #1
0
error_reporting(E_ALL);
ini_set('display_errors', 1);
/* end developer settings */
// set constant
define('TS_INIT', true);
// add autoloader
spl_autoload_register(function ($class) {
    include __DIR__ . '/classes/' . $class . '.class.php';
});
// start session
session_start();
// set global values
global $Config;
global $Log;
// create global objects
$Config = new ts_ConfigurationHandler();
$Log = new ts_Log($Config->get('loglevel'));
// create other objects
$DummyPacket = new ts_DummyPacket();
$PreParser = new ts_PreParser($DummyPacket);
// preparse all backend files
$path = __DIR__;
if ($PreParser->parse($path, $path, $Config->get('dir_runtime'), true)) {
    echo "Backend ready.<br />\n";
} else {
    echo "ERROR: Could not preparse backend!<br />\n";
}
echo "Done...\n";
/**
 * Dummy packet to get access to PreParsing object
 */
예제 #2
0
파일: index.php 프로젝트: nfrickler/tsunic
/* end developer settings */
// set constant
define('TS_INIT', true);
// add autoloader
spl_autoload_register(function ($class) {
    include __DIR__ . '/classes/' . $class . '.class.php';
});
// start session
session_start();
// set global values
global $Config;
global $TemplateEngine;
global $Database;
global $Log;
// get important objects
$Config = new ts_ConfigurationHandler();
$TemplateEngine = new ts_TemplateEngine();
$Database = new ts_Database();
$Log = new ts_Log($Config->get('loglevel'));
// get event
if (!isset($_GET['event'])) {
    $_GET['event'] = 'showIndex';
}
$public_pages = array('showLogin', 'setLogin', 'showSetLogin');
// get language
if (isset($_GET['lang'])) {
    $_SESSION['lang'] = $_GET['lang'];
}
// authentification
include_once 'functions/checkAuth.func.php';
if (!in_array($_GET['event'], $public_pages) and !checkAuth()) {