예제 #1
0
" /><br />
Save to:<br />
<input type="text" width="64" size="64" name="fileout" value="<?php 
print stripslashes($fileout);
?>
" /><br />
<input type="submit" /></form><hr />
<pre>
<?php 
if (isset($fileout) && $fileout == "") {
    unset($fileout);
}
if (isset($file) && file_exists($file)) {
    HFile_parse_file($file);
    ob_start();
    HFile_print_php_file(isset($fileout));
    $out = ob_get_contents();
    if (isset($fileout)) {
        $fd = fopen($fileout, "w");
        fputs($fd, $out);
        fclose($fd);
    }
    ob_end_flush();
}
?>
</pre>
</body></html>



예제 #2
0
function convert($file)
{
    $file = str_replace("./", "", $file);
    global $LANGNAME;
    $LANGNAME = $file;
    $LANGNAME = str_replace(".txt", "", $LANGNAME);
    $fileout = '../object/' . $LANGNAME . '.php';
    print "Writing {$file} to {$fileout}\n";
    HFile_parse_file($file);
    ob_start();
    ob_implicit_flush(0);
    HFile_print_php_file(isset($fileout));
    $out = ob_get_contents();
    ob_end_clean();
    if (isset($fileout)) {
        $fd = fopen($fileout, "w");
        fputs($fd, $out);
        fclose($fd);
    }
}