}
    if (file_exists($outfile)) {
        $exits = true;
        if (file_exists($outfile . ".old")) {
            unlink($outfile . ".old");
        }
        rename($outfile, $outfile . ".old");
    }
    $ob_file = fopen($outfile, "w");
    ob_start('ob_file_callback');
    $generating = true;
    require_once $file;
    $generating = false;
    ob_end_flush();
    fclose($ob_file);
    if (comfiles(array($outfile, $outfile . ".old")) == false) {
        if (substr($file, strlen($file) - strlen(".mak.php")) == ".mak.php") {
            $runagain = true;
        }
    }
}
info("Generation Finished with WARNINGS: {$warnings} and ERRORS: {$errors}");
if ($errors > 0) {
    exit(1);
} elseif ($runagain == true) {
    info("a makefile was generated, generation process will be executed again");
    system("make generate");
}
/** @} doxygen end group definition */
/** @} doxygen end group definition */
/*==================[end of file]============================================*/
Exemplo n.º 2
0
$isCom = $_GET['c'];
$files = scandir("../src/module/");
$contents = file_get_contents("../src/alloyimage.base.js");
function comfiles($filesDir)
{
    global $contents;
    $files = scandir($filesDir);
    foreach ($files as $file) {
        if (preg_match("/[^\\.]+\\.js\$/", $file)) {
            $contents .= file_get_contents($filesDir . $file);
        }
    }
}
comfiles("../src/module/");
comfiles("../src/module/filter/");
comfiles("../src/module/alteration/");
$wfile = fopen("../combined/alloyimage.js", "w+");
if (fwrite($wfile, $contents)) {
    echo "combined OK <br />";
    if ($isCom == "c") {
        if ($m = exec("mm")) {
            echo "Compile Completed";
        } else {
            shell_exec("`java -jar compiler.jar ..\\combined\\alloyimage.js --js_output_file=..\\combined\\alloyimage2.js`");
            echo "<span style='color:red'>error occured with compiling</span>";
        }
    } else {
        echo "combined with non-compile OK";
    }
}