} else { $watch_opts = array('enabled' => false); } $_SESSION['logging'] = $logging = $_POST['logging']; $_SESSION['goal'] = $goal = $_POST['goal']; $spec = isset($_POST['submit']) && $_POST['submit'] == 'Create GX' ? 2 : 1; $tempdir = get_directory(); $file = fopen("{$tempdir}/{$filename}", "w"); fwrite($file, $_SESSION['plfile']); fclose($file); $file = fopen("{$tempdir}/{$filename}.ann", "w"); fwrite($file, $annfile); fclose($file); chronometer(); if ($spec == 1) { $retarray = specialise($filename, $goal, $tempdir, $watch_opts, $logging, $safe); } else { $retarray = create_gx($filename, $tempdir, $watch_opts, $logging); } $time = chronometer(); if ($retarray[0] == 0) { // No error $_SESSION['specerror'] = ''; html_start('Specialising : ' . $_SESSION['filename'], 'prolog.css', '', 4, ''); echo '<div class="codeframe" style="height: 490px">'; echo process_xml($retarray[1], 'prologtohtml.xsl'); echo '</div>'; $log = $retarray[2]; print_save_link_and_save_output_to_session($filename, $spec, $tempdir); global $ecce_url; ?>
die('no goal given'); } if (isset($_POST['gx']) && $_POST['gx'] == 'on') { $spec = 2; } else { $spec = 1; } $tempdir = get_directory(); $file = fopen("{$tempdir}/{$filename}", "w"); fwrite($file, $plfile); fclose($file); $file = fopen("{$tempdir}/{$filename}.ann", "w"); fwrite($file, $annfile); fclose($file); if ($spec == 1) { $retarray = specialise($filename, $goal, $tempdir, 0, 0, $safe); $specfilename = substr($filename, 0, strlen($filename) - 3) . '.spec'; } else { $retarray = create_gx($filename, $tempdir, 0, 0); $specfilename = "{$filename}.gx"; } if ($retarray[0] == 0) { header('Content-type: application/pl'); header("Content-Disposition: attachment; filename=\"{$specfilename}\""); echo file_get_contents("{$tempdir}/{$specfilename}"); } else { echo '<pre>'; echo $retarray[2]; echo '</pre>'; } delDir($tempdir);