diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-11-13 21:57:06 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-11-13 21:57:06 +1030 |
commit | a11ff28997fb00adf9e4a77ccab5648238a65710 (patch) | |
tree | 61c0d8360a580572e2b6c5a761e862f4ae601188 | |
parent | cac3b2dd745bd86b26b176f06a7545bfa67112eb (diff) |
Junkcode now works.
-rw-r--r-- | web/staticall.php | 19 | ||||
-rw-r--r-- | web/staticjunkcode.php | 34 |
2 files changed, 44 insertions, 9 deletions
diff --git a/web/staticall.php b/web/staticall.php index 3a6407ff..122c399b 100644 --- a/web/staticall.php +++ b/web/staticall.php @@ -38,8 +38,8 @@ foreach ($modules as $module) { $summary=extract_field('summary',$argv[1].$module); $with_deps="$tar_dir/with-deps/$module.tar.bz2"; $no_deps="$tar_dir/$module.tar.bz2"; - $with_dep_size = round((filesize($argv[2]."/".$with_deps) + 1023) / 1024); - $no_dep_size = round((filesize($argv[2]."/".$no_deps) + 1023) / 1024); + $with_dep_size = round((filesize($argv[3]."/".$with_deps) + 1023) / 1024); + $no_dep_size = round((filesize($argv[3]."/".$no_deps) + 1023) / 1024); ?> <tr> <td><?=$module?></td> @@ -60,18 +60,19 @@ $d->close(); <table align="center" width="80%" border="0" cellpadding="3" cellspacing="1"> <?php -$d = dir($argv[2]."/junkcode"); -$files = array(); +$d = dir($argv[2]); +$dirs = array(); while (false !== ($entry = $d->read())) { if ($entry[0] != '.') { - array_push($files, $entry); + array_push($dirs, $entry); } } -sort($files); -foreach ($files as $file) { - $size = round((filesize($argv[2]."/junkcode/".$file) + 1023) / 1024); - echo "<tr><td><a href=\"junkcode/$file\">$file (${size}K)</a></td><tr>\n"; +sort($dirs); +foreach ($dirs as $dir) { + $size = round((filesize($argv[3]."/junkcode/".$dir.".tar.bz2") + 1023) / 1024); + echo "<tr><td><a href=\"junkcode/$dir.tar.bz2\">$dir.tar.bz2 (${size}K)</a></td>\n"; + echo "<td><a href=\"junkcode/$dir.html\">Browse contents...</a></td><tr>\n"; } $d->close(); ?> diff --git a/web/staticjunkcode.php b/web/staticjunkcode.php new file mode 100644 index 00000000..bf342152 --- /dev/null +++ b/web/staticjunkcode.php @@ -0,0 +1,34 @@ +<?php +session_start(); +include('logo.html'); +include('menulist.html'); +include('static-configuration'); +?> + +<h1> Contents of CCAN <?=$argv[1]?> </h1> +<p> + +<table align="center" width="80%" border="0" cellpadding="3" cellspacing="1"> +<?php +$d = dir($argv[1]); +$files = array(); +while (false !== ($entry = $d->read())) { + if ($entry[0] != '.') { + array_push($files, $entry); + } +} +$d->close(); +sort($files); + +foreach ($files as $file) { + $size = round((filesize($argv[1]."/".$file) + 1023) / 1024); + ?> + <tr> + <td><a href="<?=$argv[2]."/".$file?>"><?=$file?> (<?=$size?>K)</td> + </tr> + <?php +} +?> +</table> +<hr> +</body></html> |