<?php require_once __DIR__ . '/../app/bootstrap.php'; header('Content-Type: application/xml; charset=utf-8'); $products=App\Core\Database::fetchAll('SELECT slug, updated_at FROM products WHERE status="published" LIMIT 500'); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n"; foreach(['public/index.php','public/products.php','vendor/index.php'] as $path){ echo '<url><loc>'.e(url($path))."</loc></url>\n"; } foreach($products as $p){ echo '<url><loc>'.e(url('product/'.$p['slug'])).'</loc><lastmod>'.e(substr($p['updated_at'] ?? date('c'),0,10))."</lastmod></url>\n"; } echo '</urlset>';
