public function run3() { Qdmvc::loadHelper('class.Diff'); $diff = Diff::compare('Ngay do', 'Ngay mua', true); echo Diff::toHTML($diff, ''); return; foreach ($diff as $item) { if ($item[1] == Diff::DELETED) { echo $item[0]; } } echo '<br>'; foreach ($diff as $item) { if ($item[1] == Diff::INSERTED) { echo $item[0]; } } ?> <?php }
} echo "-----------------Diff show me the differ : ------------------\n"; $originalOPTB_WOCFile = ORIGIN_FILE_PATH . $path_parts['filename'] . '-objectcode.txt'; if (file_exists($originalOPTB_WOCFile)) { $diffOPTB_WOC = Diff::compareFiles($originalOPTB_WOCFile, $OPTB_WOCtxtFile); echo Diff::toString($diffOPTB_WOC); create_file(RESULT_PATH . $OUTPUT_LOG_PREFIX . "diff-OPTB_WOC.html", Diff::toHTML($diffOPTB_WOC)); echo "\n"; } else { echo $originalOPTB_WOCFile . "\n" . 'do not exist' . "\n"; } $orignalObjectPFile = ORIGIN_FILE_PATH . $path_parts['filename'] . '-objectprogram.txt'; if (file_exists($orignalObjectPFile)) { $diffObjectP = Diff::compareFiles($orignalObjectPFile, $obectProgramTxtFile); echo Diff::toString($diffObjectP); create_file(RESULT_PATH . $OUTPUT_LOG_PREFIX . "diff-ObjectProgram.html", Diff::toHTML($diffObjectP)); echo "\n"; } else { echo $orignalObjectPFile . "\n" . 'do not exist' . "\n"; } echo "-------------------------Diff end ----------------------------\n"; compare_array_in_html_js(RESULT_PATH . $OUTPUT_LOG_PREFIX . "compare_html_js.html", $OPTB_WOC, $orignalCode, "Compare Array", false); } ## end ## print out OPTB } } } } } } }