Mercurial > hg > anonet-resdb
view doc/ucis.ano/bgp_graph/path_list_to_xml.php @ 846:46f437d5809d draft
Merge commit '3c8894eee4e8b446c8839e10236fbc90dd0a916d'
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Tue, 20 Dec 2011 22:05:49 +0000 |
parents | 4dbe5bf653bb |
children |
line wrap: on
line source
#!/usr/bin/php <?php $nodes = array(); $file = STDIN; while (!feof($file)) { $line = stream_get_line($file, 1024, "\n"); if ($line === NULL) break; if (!strlen($line)) continue; $pathnodes = explode(' ', $line); $prevnode = NULL; foreach ($pathnodes as $node) { if ($node && $prevnode) print('<link from="'.$node.'" to="'.$prevnode.'" total="1" />'."\n"); $prevnode = $node; } }