- report generation windows was added to game manager - full TeX source downloading compressed into a ZIP
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
require_once "vendor/autoload.php";
|
|
|
|
const DATADIR = "appdata";
|
|
const GAMEMEDIA_DIR = DATADIR . DIRECTORY_SEPARATOR . "game_media";
|
|
const GAME_FILE = "challenges.json";
|
|
const USERDB = "users";
|
|
const GROUPDB = "groups";
|
|
const GAMEDB = "games";
|
|
const TESTDB = "tests";
|
|
const INSTALL_INDICATOR = "INSTALLED";
|
|
const QUIZMASTER_NICKNAME = "quizmaster";
|
|
const LOGIN_URL = "login.php";
|
|
const MAIN_URL = "main.php";
|
|
const SESSION_NAME = "spreadquiz_sid";
|
|
const MAINTENANCE_FLAG_FILE = "MAINTENANCE";
|
|
const MISSING_IMAGE_PLACEHOLDER = "media/image-missing_120px.png";
|
|
const REPORT_DIR = "report";
|
|
const REPORT_TEMPLATE_DIR = REPORT_DIR . DIRECTORY_SEPARATOR . "template";
|
|
const REPORT_PDF_OUTPUT_DIR = REPORT_DIR . DIRECTORY_SEPARATOR . "output";
|
|
const TEX_ENGINE = "xelatex";
|
|
|
|
session_name(SESSION_NAME);
|
|
|
|
// autoload session
|
|
if ((session_status() === PHP_SESSION_NONE) && isset($_COOKIE[SESSION_NAME])) {
|
|
session_start();
|
|
}
|
|
|
|
// ----------
|
|
|
|
// initialize data directory
|
|
function init_datadir() {
|
|
if (!file_exists(DATADIR)) {
|
|
mkdir(DATADIR);
|
|
mkdir(GAMEMEDIA_DIR);
|
|
mkdir(REPORT_DIR);
|
|
mkdir(REPORT_PDF_OUTPUT_DIR);
|
|
}
|
|
}
|
|
|