sessionname = 'estafetalms360'; // URL base del sitio (debe terminar en "/") $CFG->wwwroot = getenv('APP_URL') ?: 'http://localhost/git/LMS-Estafeta/'; $CFG->wwwuserhome = $CFG->wwwroot . 'dashboard.php'; $CFG->realpath = dirname(__DIR__); $CFG->masteryscore = 80; // Base de datos (preferentemente por variables de entorno) $dbname = getenv('DB_NAME') ?: 'estafeta_lms3'; $dbhost = getenv('DB_HOST') ?: 'localhost'; $dbuser = getenv('DB_USER') ?: 'root'; $dbpass = getenv('DB_PASS') ?: ''; function dbConnect() { global $dbname, $dbhost, $dbuser, $dbpass, $link; $link = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname); if (!$link) { http_response_code(500); die('Error de conexión a la base de datos.'); } mysqli_set_charset($link, 'utf8mb4'); } function getEncrypt($text) { return $text; }