Files
xamxam/app/public/admin/actions/cleanup-stats.php
T

25 lines
617 B
PHP

<?php
/**
* Temp file statistics endpoint (admin).
*
* GET /admin/actions/cleanup-stats.php
*
* Returns JSON with counts and sizes of tmp/filepond/ and tmp/_trash/,
* broken down by stale (will be cleaned) vs active (still session-bound).
*/
require_once __DIR__ . '/../../../bootstrap.php';
require_once __DIR__ . '/../../../src/AdminAuth.php';
AdminAuth::requireLogin();
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
http_response_code(405);
return;
}
require_once __DIR__ . '/_cleanup-stats-data.php';
header('Content-Type: application/json; charset=utf-8');
echo json_encode(getCleanupStats());