Added options page
This commit is contained in:
16
src/includes/api/cache.php
Normal file
16
src/includes/api/cache.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['is_admin'])) exit(json_encode(['error'=>'Not authorized']));
|
||||
|
||||
$cacheDir = __DIR__.'/../../cache';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if(!is_dir($cacheDir)){
|
||||
echo json_encode(['error'=>'Cache folder not found']); exit;
|
||||
}
|
||||
|
||||
$files = glob($cacheDir.'/*');
|
||||
foreach($files as $f){ if(is_file($f)) unlink($f); }
|
||||
|
||||
echo json_encode(['message'=>'Cache cleared']);
|
||||
Reference in New Issue
Block a user