$reduce->set_checking_function("check_against_compiled"); if ($opt_failure) { $reduce->set_checking_function("check_for_failure_string"); } if ($opt_interpret) { $reduce->set_checking_function("check_against_interpreted"); } $input = file_get_contents($filename); // TODO: call this on the first instance if ($opt_command != "") { // TODO use opt_command on the first instance // TODO: use --no-xml-attrs throw new Exception("TODO"); } if ($opt_xml) { $result = $reduce->run_on_xml($input); } else { $result = $reduce->run_on_php($input); } print "Writing reduced file to {$filename}.reduced\n"; file_put_contents("{$filename}.reduced", $result); /* * Callbacks for reduce */ function myrun($command, $stdin = NULL) { if ($stdin === NULL) { mydebug(2, "Running command: {$command}"); } else { mydebug(2, "Running command with stdin: {$command}"); }