16965ee8cb
- DATA_PATH : chemin /data hors document root, configurable via .env (fallback sur BASE_PATH/data si absent) - DataGit : auto-commit git sur toutes les écritures articles/livres (create, update, delete, meta, tags, fichiers, liens…) sauf autosave - UpdateChecker : getBranch() / getLastChecked() / clearCache(), branche configurable via FOLIO_UPDATE_BRANCH (plus de main hardcodé) - Admin dashboard : affiche la branche suivie, date du dernier contrôle, bouton Vérifier pour forcer le check sans attendre le TTL - CLAUDE.md : architecture DATA_PATH et flux de déploiement documentés Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
813 B
PHP
30 lines
813 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
if (!defined('BASE_PATH')) {
|
|
define('BASE_PATH', __DIR__);
|
|
}
|
|
|
|
if (!defined('DATA_PATH')) {
|
|
$__dataPath = $_ENV['DATA_PATH'] ?? getenv('DATA_PATH') ?: '';
|
|
define('DATA_PATH', $__dataPath !== '' ? rtrim($__dataPath, '/') : BASE_PATH . '/data');
|
|
unset($__dataPath);
|
|
}
|
|
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
$isHttps = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
|
|
$sessionName = $_ENV['SESSION_NAME'] ?? (getenv('SESSION_NAME') ?: null);
|
|
if ($sessionName !== null && $sessionName !== '') {
|
|
session_name($sessionName);
|
|
}
|
|
session_set_cookie_params([
|
|
'lifetime' => 0,
|
|
'path' => '/',
|
|
'secure' => $isHttps,
|
|
'httponly' => true,
|
|
'samesite' => 'Lax',
|
|
]);
|
|
session_start();
|
|
}
|