staticmoduleinfo.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. session_start();
  3. include('logo.html');
  4. include('menulist.html');
  5. include('static-configuration');
  6. $module_path=$argv[1];
  7. $module=basename($module_path);
  8. $maintainer=extract_field('maintainer',$module_path);
  9. $author=extract_field('author',$module_path);
  10. $summary=extract_field('summary',$module_path);
  11. $description=htmlize_field('description',$module_path);
  12. $example=extract_field('example',$module_path);
  13. $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module_path));
  14. $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module_path));
  15. $licence=extract_field('licence',$module_path);
  16. ?>
  17. <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
  18. <tr align="center" bgcolor="FFFFCC">
  19. <td>
  20. <a href="<?=$repo_base.$module?>">Browse Source</a>
  21. </td>
  22. <td>
  23. <a href="../<?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
  24. <a href="../<?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
  25. </tr>
  26. </table>
  27. <p>
  28. </p>
  29. <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="8" cellspacing="1">
  30. <tr align="left" bgcolor="FFFFCC">
  31. <td><h3>Module: </h3> <?=$module?> </td>
  32. </tr>
  33. <tr align="left" bgcolor="FFFFCC">
  34. <td><h3>Summary: </h3> <?=$summary?></td>
  35. </tr>
  36. <?php
  37. if ($maintainer) {
  38. ?>
  39. <tr align="left" bgcolor="FFFFCC">
  40. <td><h3>Maintainer: </h3> <?=$maintainer?></td>
  41. </tr>
  42. <?php
  43. }
  44. if ($author) {
  45. ?>
  46. <tr align="left" bgcolor="FFFFCC">
  47. <td><h3>Author: </h3> <?=$author?></td>
  48. </tr>
  49. <?php
  50. }
  51. if ($dependencies) {
  52. ?>
  53. <tr align="left" bgcolor="FFFFCC">
  54. <td><h3>Dependencies: </h3> <pre> <?php
  55. foreach (preg_split("/\s+/", $dependencies) as $dep) {
  56. echo '<a href="'.substr($dep, 5).'.html">'.$dep.'</a> ';
  57. }
  58. ?></pre></td>
  59. </tr>
  60. <?php
  61. }
  62. if ($extdepends) {
  63. ?>
  64. <tr align="left" bgcolor="FFFFCC">
  65. <td><h3>External dependencies: </h3> <?php
  66. foreach (split("\n", $extdepends) as $dep) {
  67. $fields=preg_split("/\s+/", $dep);
  68. echo $fields[0].' ';
  69. if (count($fields) > 1)
  70. echo '(version '.$fields[1].') ';
  71. echo '<br>';
  72. }
  73. ?></td>
  74. </tr>
  75. <?php
  76. }
  77. ?>
  78. <tr align="left" bgcolor="FFFFCC">
  79. <td><h3>Description: </h3> <?=$description;?> </td>
  80. </tr>
  81. <?php
  82. if ($example) {
  83. ?>
  84. <tr align="left" bgcolor="FFFFCC">
  85. <td><h3>Example: </h3> <pre><?=$example?></pre></td>
  86. </tr>
  87. <?php
  88. }
  89. if ($licence) {
  90. ?>
  91. <tr align="left" bgcolor="FFFFCC">
  92. <td><h3>Licence: </h3> <?=$licence?></td>
  93. </tr>
  94. <?php
  95. }
  96. ?>
  97. </table><hr>
  98. </body></html>