From 51be336ded6996c02050d2d5142ca818c07119ff Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 19 Dec 2007 09:26:21 +0000 Subject: Fixed association of entries to update, added no-cache headers, added a bit of error reporting in case of invalid zip files, kept original ordering of the update list and sorted the list of entries on their filename. --- tools/upalyzer/analyze.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'tools/upalyzer/analyze.php') diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php index 36842a6d..7a3c3e30 100644 --- a/tools/upalyzer/analyze.php +++ b/tools/upalyzer/analyze.php @@ -18,6 +18,11 @@ * along with upalyzer; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +header("Content-type: text/html"); +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + ?> Update analysis @@ -66,15 +71,18 @@ foreach ($update_file as $update_line) $update['size'] += $entry_size; if ($entry_used) { + $update_entries[$entry_name] = $update['file']; $update['used_entry_count']++; $update['used_size'] += $entry_size; } - $update_entries[$entry_name] = $update['file']; $update_entry_maxlen = max($update_entry_maxlen, strlen($entry_name)); } zip_close($zip); } + else { + $update['zip_error'] = true; + } $update['entries'] = $entries; $update['used_percentage'] = $update['used_size'] / $update['size']; @@ -86,15 +94,19 @@ foreach ($update_file as $update_line) $data_overhead_size += $update['filesize'] - $update['size']; } -foreach ($updates as &$update) +foreach (array_reverse($updates) as $update) { printf("%-{$update_file_maxlen}s ", $update['file']); echo $update['adler32']; printf(" %4d kb", $update['filesize'] / 1024); - printf(" %4d kb", $update['uncompressed_size'] / 1024); - printf(" %3d%% used (%d/%d files)", $update['used_percentage'] * 100, - $update['used_entry_count'], - count($update['entries'])); + if (!$update['zip_error']) { + printf(" %4d kb", $update['uncompressed_size'] / 1024); + printf(" %3d%% used (%d/%d files)", $update['used_percentage'] * 100, + $update['used_entry_count'], + count($update['entries'])); + } else { + printf(" Error!"); + } echo "\n"; } @@ -109,6 +121,8 @@ printf("Obsoleted data: %4d kb (%d%%)\n", printf("\n"); +ksort($update_entries); + foreach ($update_entries as $entry => $update) { printf("%-{$update_entry_maxlen}s %s\n", $entry, $update); -- cgit v1.2.3-70-g09d2