<?php
require __DIR__.'/bootstrap.php'; require_auth(); [, $file]=storage_paths($config); $s=read_state($file); if((int)$s['revision']===0) respond(['error'=>'No existe respaldo en el servidor.'],404);
header_remove('Content-Type'); header('Content-Type: application/json; charset=utf-8'); header('Content-Disposition: attachment; filename="SIAPA-servidor-rev-'.$s['revision'].'-'.date('Ymd-His').'.json"'); echo json_encode($s,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); exit;
