SpreadQuiz/globals.php
Epagris 59e113333a - human readable to unix timestamp conversion in clion code added
- test-related request block redesigned
- elvis operator replaced with the more adequate null coalescing one
2024-09-12 14:35:36 +02:00

37 lines
842 B
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 MISSING_IMAGE_PLACEHOLDER = "media/image-missing_120px.png";
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);
}
}