123456789101112131415161718192021222324252627 |
- <?php
- define("ENVIRONMENT", getenv("ENVIRONMENT") ?? "production");
- define("ROOT_PATH", dirname(__FILE__));
- define("SYSTEM_PATH", "/var/daktylos");
- define("LOG_PATH", SYSTEM_PATH . '/logs/');
- define("DATA_PATH", SYSTEM_PATH . '/data/');
- define("DBNAME", "daktylos-".ENVIRONMENT.".sqlite3");
- function daktylos_autoload($classname){
- require_once ROOT_PATH . "/libs/" . $classname . ".class.php";
- }
- spl_autoload_register("daktylos_autoload");
- $sessionId = $_POST['auth_token'] ?? $_GET['auth_token'] ?? null;
- if(!empty($sessionId)) {
- session_id($sessionId);
- }
- session_start();
- $_SESSION['last_access'] = time(); //session write access to prevent timeout
- define("DOMAIN",explode(".", strtolower($_SERVER['HTTP_HOST']))[0]);
- define("CACHEBUST", 4);
- include_once("config.".ENVIRONMENT.".php");
|