]> git.ozlabs.org Git - ccan/blobdiff - web/staticall.php
Static generation of web pages. Based on GSoC work, and still needs
[ccan] / web / staticall.php
diff --git a/web/staticall.php b/web/staticall.php
new file mode 100644 (file)
index 0000000..3a6407f
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+session_start();
+include('logo.html');
+include('menulist.html');
+include('static-configuration');
+
+$tarballsize=round((filesize($argv[2]."/ccan.tar.bz2") + 1023) / 1024);
+?>
+
+<h1> List of all CCAN modules: </h1>
+
+<p>
+Note that two downloads are offered: the first includes with all the
+other ccan modules this module uses, the second is a standalone
+download.
+</p>
+
+<p>
+Or you can just download the <a href="ccan.tar.bz2">tarball of everything (<?=$tarballsize?>K)</a>.
+</p>
+
+<table align="center" width="80%" border="0" cellpadding="3" cellspacing="1">
+<th align="left">Name</th>
+<th align="left">Summary / Link to details</th>
+<th align="right">Download</th>
+
+<?php 
+$d = dir($argv[1]);
+$modules = array();
+while (false !== ($entry = $d->read())) {
+       if ($entry[0] != '.') {
+               array_push($modules, $entry);
+       }
+}
+sort($modules);
+
+foreach ($modules as $module) {
+       $summary=extract_field('summary',$argv[1].$module);
+       $with_deps="$tar_dir/with-deps/$module.tar.bz2";
+       $no_deps="$tar_dir/$module.tar.bz2";
+       $with_dep_size = round((filesize($argv[2]."/".$with_deps) + 1023) / 1024);
+       $no_dep_size = round((filesize($argv[2]."/".$no_deps) + 1023) / 1024);
+       ?>
+       <tr>
+         <td><?=$module?></td>
+         <td><a href="info/<?=$module?>.html"><?=$summary?></a></td>
+         <td align="right"><a href="<?=$with_deps?>"><?=$with_dep_size?>K</a> / 
+             <a href="<?=$no_deps?>"><?=$no_dep_size?>K</a></td>
+       </tr>
+       <?php
+}
+$d->close();
+?>
+</table>
+
+<h2> Contents of Junkcode: </h2>
+
+(This is contributed code which was dumped here: these gems may need some polishing.)
+
+<table align="center" width="80%" border="0" cellpadding="3" cellspacing="1">
+
+<?php
+$d = dir($argv[2]."/junkcode");
+$files = array();
+while (false !== ($entry = $d->read())) {
+       if ($entry[0] != '.') {
+               array_push($files, $entry);
+       }
+}
+
+sort($files);
+foreach ($files as $file) {
+       $size = round((filesize($argv[2]."/junkcode/".$file) + 1023) / 1024);
+       echo "<tr><td><a href=\"junkcode/$file\">$file (${size}K)</a></td><tr>\n";
+}
+$d->close();
+?>
+</table>
+<hr>
+</body></html>