]> git.ozlabs.org Git - ccan/blob - web/staticmoduleinfo.php
tal/str: new module.
[ccan] / web / staticmoduleinfo.php
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
31 <p>
32 </p>
33
34 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="8" cellspacing="1">
35 <tr align="left" bgcolor="FFFFCC">
36 <td><h3>Module: </h3> <?=$module?> </td>
37 </tr>
38
39 <tr align="left" bgcolor="FFFFCC">
40 <td><h3>Summary: </h3> <?=$summary?></td>
41 </tr>
42
43 <?php
44 if ($maintainer) {
45 ?>
46 <tr align="left" bgcolor="FFFFCC"> 
47 <td><h3>Maintainer: </h3> <?=$maintainer?></td>
48 </tr>
49 <?php
50 }
51
52 if ($author) {
53 ?>
54 <tr align="left" bgcolor="FFFFCC"> 
55 <td><h3>Author: </h3> <?=$author?></td>
56 </tr>
57 <?php
58 }
59
60 if ($dependencies) {
61 ?>
62 <tr align="left" bgcolor="FFFFCC">
63 <td><h3>Dependencies: </h3> <pre> <?php
64         foreach (preg_split("/\s+/", $dependencies) as $dep) {
65                 echo '<a href="'.substr($dep, 5).'.html">'.$dep.'</a> ';
66         }
67 ?></pre></td>
68 </tr>
69 <?php 
70 }
71
72 if ($extdepends) {
73 ?>
74 <tr align="left" bgcolor="FFFFCC">
75 <td><h3>External dependencies: </h3> <?php
76         foreach (split("\n", $extdepends) as $dep) {
77                 $fields=preg_split("/\s+/", $dep);
78                 echo $fields[0].' ';
79                 if (count($fields) > 1)
80                         echo '(version '.$fields[1].') ';
81                 echo '<br>';
82         }
83 ?></td>
84 </tr>
85 <?php 
86 }
87 ?>
88 <tr align="left" bgcolor="FFFFCC">
89 <td><h3>Description: </h3> <?=$description;?> </td>
90 </tr>
91
92 <?php 
93 if ($see_also) {
94 ?>
95 <tr align="left" bgcolor="FFFFCC">
96 <td><h3>See Also: </h3> <pre> <?php
97         foreach (preg_split("/[\s,]+/", trim($see_also)) as $see) {
98                 echo '<a href="'.substr($see, 5).'.html">'.$see.'</a> ';
99         }
100 ?></pre></td>
101 </tr>
102 <?php
103 }
104
105 if ($example) {
106 ?>
107 <tr align="left" bgcolor="FFFFCC"> 
108 <td><h3>Example: </h3> <pre><?=$example?></pre></td>
109 </tr>
110 <?php
111 }
112
113 if ($licence) {
114 ?>
115 <tr align="left" bgcolor="FFFFCC"> 
116 <td><h3>License: </h3> <?=$licence?></td>
117 </tr>
118 <?php
119 }
120
121 if ($license) {
122 ?>
123 <tr align="left" bgcolor="FFFFCC"> 
124 <td><h3>License: </h3> <?=$license?></td>
125 </tr>
126 <?php
127 }
128 ?>
129 </table><hr>
130 </body></html>