mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
cleanup modal: list stale files to remove; storage restructure: documents/ → {objet}/
This commit is contained in:
1 parent
c6199525f9
commit
defc919cd0
19 files changed
+292
-22
No files matched your search
@@ -2335,9 +2335,15 @@ class Database
|
||||
|
||||
// Clean up thesis files from disk
|
||||
$files = $this->getThesisFiles($thesisId);
|
||||
$storageRoot = defined('STORAGE_ROOT') ? STORAGE_ROOT : '/var/www/xamxam/storage';
|
||||
foreach ($files as $file) {
|
||||
if (!empty($file['file_path']) && file_exists($file['file_path'])) {
|
||||
@unlink($file['file_path']);
|
||||
$fp = $file['file_path'] ?? '';
|
||||
if ($fp === '' || str_starts_with($fp, 'http://') || str_starts_with($fp, 'https://') || str_starts_with($fp, 'peertube_ids:')) {
|
||||
continue;
|
||||
}
|
||||
$abs = $storageRoot . '/' . $fp;
|
||||
if (file_exists($abs)) {
|
||||
@unlink($abs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user