staticmoduleinfo.php 2.9 KB

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