c2ephp

tests/pray-extract.php

Go to the documentation of this file.
00001 <?php
00002 require_once(dirname(__FILE__).'/../agents/PRAYFile.php');
00003 require_once(dirname(__FILE__).'/../support/FileReader.php');
00004 
00005 $agent = new PRAYFile(new FileReader($argv[1]));
00006 $names = array();
00007 foreach($agent->GetBlocks() as $block) {
00008     $blockname = $block->GetName().'.'.$block->GetType();
00009     while(in_array($blockname,$names)) {
00010         $blockname .= '-';
00011     }
00012     echo $blockname."\n";
00013     $fh = fopen($blockname,'w');
00014     fwrite($fh,$block->GetData());
00015     fclose($fh);
00016 }
00017 
00018 ?>
 All Classes Files Functions Variables Enumerations