0, 'path' => '/', 'secure' => $isHttps, 'httponly' => true, 'samesite' => 'Lax']); session_start(); } require_once BASE_PATH . '/src/auth.php'; require_once BASE_PATH . '/config/config.php'; require_once BASE_PATH . '/src/ArticleManager.php'; const FEED_PAGE_SIZE = 20; $articles = new ArticleManager(BASE_PATH . '/data'); $now = time(); $base = rtrim(APP_URL, '/'); $all = array_values(array_filter( $articles->getAll(publishedOnly: true), static fn (array $a): bool => strtotime((string)($a['published_at'] ?? '')) <= $now )); $total = count($all); $lastPage = max(1, (int)ceil($total / FEED_PAGE_SIZE)); $page = max(1, min($lastPage, (int)($_GET['page'] ?? 1))); $items = array_slice($all, ($page - 1) * FEED_PAGE_SIZE, FEED_PAGE_SIZE); $feedUrl = static fn (int $p): string => $base . '/feed' . ($p > 1 ? '?page=' . $p : ''); $lastBuild = ''; foreach ($all as $a) { $ts = (int)strtotime((string)($a['updated_at'] ?? $a['published_at'] ?? '')); if ($ts > (int)strtotime($lastBuild ?: '1970-01-01')) { $lastBuild = date(DATE_RSS, $ts); } } if ($lastBuild === '') { $lastBuild = date(DATE_RSS); } header('Content-Type: application/rss+xml; charset=UTF-8'); header('X-Content-Type-Options: nosniff'); echo '' . "\n"; ?> varlog Journal personnel de Cédrix — informatique, hack et loisirs techniques. fr 1): ?>