$p, 'dir' => $accum]; } } // Gather entries $entries = []; if (is_dir($realCurrent)) { $dh = opendir($realCurrent); if ($dh) { while (($name = readdir($dh)) !== false) { if ($name === '.' || $name === '..') continue; $full = $realCurrent . '/' . $name; $isDir = is_dir($full); $entries[] = [ 'name' => $name, 'is_dir' => $isDir, 'size' => $isDir ? null : filesize($full), 'ext' => $isDir ? null : strtolower(pathinfo($name, PATHINFO_EXTENSION)), ]; } closedir($dh); } } // Sort: dirs first, then files, alphabetical usort($entries, function ($a, $b) { if ($a['is_dir'] !== $b['is_dir']) return $a['is_dir'] ? -1 : 1; return strnatcasecmp($a['name'], $b['name']); }); // Human-readable filesize function fmtSize(?int $bytes): string { if ($bytes === null) return ''; if ($bytes >= 1_000_000_000) return round($bytes / 1_000_000_000, 1) . ' GB'; if ($bytes >= 1_000_000) return round($bytes / 1_000_000, 1) . ' MB'; if ($bytes >= 1_000) return round($bytes / 1_000, 1) . ' KB'; return $bytes . ' B'; } // Determine parent dir $parentDir = ''; if ($relDir !== '') { $parentParts = explode('/', $relDir); array_pop($parentParts); $parentDir = implode('/', $parentParts); } $rootDirs = ['documents', 'theses']; ?>

Sélectionnez un dossier pour parcourir les fichiers orphelins.

Ce dossier est vide.