12; }; $examples = getAllExampleGraphs(); $msg = "Deleted files: "; $deletedCount = 0; $ageDelActionCallback = function(&$ageCount, $file) use($examples, &$msg, &$deletedCount) { // Ignory examples. foreach ($examples as $item) { if (strpos ($file, $item["id"]) !== FALSE) { return; } } // Ignore test graphs if (str_ends_with ($item["id"], "_test")) { return; } if (unlink($file)) { $msg = $msg . $file . ", "; $deletedCount = $deletedCount + 1; } }; processFiles($g_config['graphSavePath'] . "*.png", $totalImages, $totalImagesSize, $ageImage, $age1yMoreCallback, $ageDelActionCallback); $msg = $msg . "
" . "Total: $deletedCount"; } $ageActionCallback = function(&$ageCount, $file) { $ageCount = $ageCount + 1; }; processFiles($g_config['graphSavePath'] . "*.xml", $totalGraphCount, $totalGraphSize, $ageGraph, $age6mLessCallback, $ageActionCallback); processFiles($g_config['graphSavePath'] . "autosave/*.xml", $totalAutosaveGraphCount, $totalAutosaveGraphSize, $ageAutosaveGraph, $age1mLessCallback, $ageActionCallback); processFiles($g_config['graphSavePath'] . "*.png", $totalImages, $totalImagesSize, $ageImage, $age6mLessCallback, $ageActionCallback); $totalGraphSize = intval($totalGraphSize); $totalImagesSize = intval($totalImagesSize); ?>