mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 07:11:18 +02:00
25 lines
617 B
PHP
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());
|