staticall.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. session_start();
  3. include('logo.html');
  4. include('menulist.html');
  5. include('static-configuration');
  6. $tarballsize=round((filesize($argv[2]."/ccan.tar.bz2") + 1023) / 1024);
  7. ?>
  8. <h1> List of all CCAN modules: </h1>
  9. <p>
  10. Note that two downloads are offered: the first includes with all the
  11. other ccan modules this module uses, the second is a standalone
  12. download.
  13. </p>
  14. <p>
  15. Or you can just download the <a href="ccan.tar.bz2">tarball of everything (<?=$tarballsize?>K)</a>.
  16. </p>
  17. <table align="center" width="80%" border="0" cellpadding="3" cellspacing="1">
  18. <th align="left">Name</th>
  19. <th align="left">Summary / Link to details</th>
  20. <th align="right">Download</th>
  21. <?php
  22. $d = dir($argv[1]);
  23. $modules = array();
  24. while (false !== ($entry = $d->read())) {
  25. if ($entry[0] != '.') {
  26. array_push($modules, $entry);
  27. }
  28. }
  29. sort($modules);
  30. foreach ($modules as $module) {
  31. $summary=extract_field('summary',$argv[1].$module);
  32. $with_deps="$tar_dir/with-deps/$module.tar.bz2";
  33. $no_deps="$tar_dir/$module.tar.bz2";
  34. $with_dep_size = round((filesize($argv[2]."/".$with_deps) + 1023) / 1024);
  35. $no_dep_size = round((filesize($argv[2]."/".$no_deps) + 1023) / 1024);
  36. ?>
  37. <tr>
  38. <td><?=$module?></td>
  39. <td><a href="info/<?=$module?>.html"><?=$summary?></a></td>
  40. <td align="right"><a href="<?=$with_deps?>"><?=$with_dep_size?>K</a> /
  41. <a href="<?=$no_deps?>"><?=$no_dep_size?>K</a></td>
  42. </tr>
  43. <?php
  44. }
  45. $d->close();
  46. ?>
  47. </table>
  48. <h2> Contents of Junkcode: </h2>
  49. (This is contributed code which was dumped here: these gems may need some polishing.)
  50. <table align="center" width="80%" border="0" cellpadding="3" cellspacing="1">
  51. <?php
  52. $d = dir($argv[2]."/junkcode");
  53. $files = array();
  54. while (false !== ($entry = $d->read())) {
  55. if ($entry[0] != '.') {
  56. array_push($files, $entry);
  57. }
  58. }
  59. sort($files);
  60. foreach ($files as $file) {
  61. $size = round((filesize($argv[2]."/junkcode/".$file) + 1023) / 1024);
  62. echo "<tr><td><a href=\"junkcode/$file\">$file (${size}K)</a></td><tr>\n";
  63. }
  64. $d->close();
  65. ?>
  66. </table>
  67. <hr>
  68. </body></html>