function readDirectory($params) { global $fileDir; if (isset($params["directory"])) { $dir = $fileDir . $params["directory"]; outputDirectoryListing($dir); } else { outputDirectoryListing($fileDir); } }
function outputDirectoryListing($directory, $recursive = true) { if (!is_dir($directory)) { return; } $dir = opendir($directory); if (substr($directory, strlen($directory) - 1, 1) !== "/") { $directory .= "/"; } while (($file = readdir($dir)) !== false) { if (filetype($directory . $file) === "dir") { if ($recursive) { if ($file !== "." && $file !== "..") { outputDirectoryListing($directory . $file, true); } } } else { echo encodeUrlEntity($directory . $file); echo " #modification time: "; echo filemtime($directory . $file); echo "\n"; } } }
#index modificationtime: <?php echo filemtime("index.php"); ?> #configuration modificationtime: <?php echo filemtime("configuration.php"); ?> #htaccess modificationtime: <?php echo filemtime(".htaccess"); ?> CACHE: <?php outputDirectoryListing("css"); outputDirectoryListing("js"); outputDirectoryListing("lib"); outputDirectoryListing("img/icons"); outputDirectoryListing("img/html5apps"); outputDirectoryListing("img", false); outputDirectoryListing("fonts"); ?> fonts/fontawesome-webfont.ttf?v=4.0.3 #<?php echo filemtime("fonts/fontawesome-webfont.ttf"); ?> php/titlesDB.php # <?php echo filemtime("php/titlesDB.php"); //TODO: specify this in a way that doesn't depend on the php scripts modification time ?> NETWORK: *