staticmoduleinfo.php 2.7 KB

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