You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: viewdiff-ex.php
+2-15
Original file line number
Diff line number
Diff line change
@@ -82,22 +82,9 @@
82
82
#htmldiff.onlyInsertions del {display:none}
83
83
</style>
84
84
<title>PHP Fine Diff</title>
85
-
<script type="text/javascript">
86
-
var _gaq = _gaq || [];
87
-
_gaq.push(['_setAccount', 'UA-5586753-2']);
88
-
_gaq.push(['_trackPageview']);
89
-
(function() {
90
-
var ga = document.createElement('script');
91
-
ga.type = 'text/javascript';
92
-
ga.async = true;
93
-
ga.src = 'http://www.google-analytics.com/ga.js';
94
-
var s = document.getElementsByTagName('script')[0];
95
-
s.parentNode.insertBefore(ga, s);
96
-
})();
97
-
</script>
98
85
</head>
99
86
<body>
100
-
<a href="https://github.com/gorhill/PHP-FineDiff"><img style="position:absolute;top:0;right:0;border:0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
87
+
<a href="https://github.com/gorhill/PHP-FineDiff"><img style="position:absolute;top: 0; right: 0; border:0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
101
88
<h1>PHP Fine Diff</h1>
102
89
<div>
103
90
<p style="margin-right:5em">This page demonstrate the <a href="finediff-code.php"><code>FineDiff</code></a> class (as in “<b>fine</b> granularity <b>diff</b>”) I wrote – starting from scratch – to generate a <u>lossless</u> (won't eat your line breaks), <u>compact</u> opcodes string listing the sequence of atomic actions (copy/delete/insert) necessary to transform one string into another (thereafter referred as the “From” and “To” string). The “To” string can be rebuilt by running the opcodes string on the “From” string. The <code>FineDiff</code> class allows to specify the granularity, and up to character-level granularity is possible, in order to generate the smallest diff possible (at the <i>potential</i> cost of increased CPU cycles.)</p>
@@ -281,7 +268,7 @@ function extractFragments($text, $delimiter) {
<a href="https://github.com/gorhill/PHP-FineDiff"><img style="position:absolute;top:0;right:0;border:0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
23
+
<a href="https://github.com/gorhill/PHP-FineDiff"><img style="position:absolute;top: 0; right: 0; border:0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
34
24
<h1>PHP Fine Diff: Online Diff Viewer</h1>
35
25
<div>
36
26
<?php
@@ -42,54 +32,146 @@ function stripslashes_deep(&$value) {
echo'<p style="margin-right:8em;font-size:smaller">Tempolink: <a href="viewdiff.php?data=', $data_key, '">http://', $_SERVER['HTTP_HOST'], '/viewdiff.php?data=', $data_key, '</a> <span style="color:#aaa">(This link is not viewable by others, unless it has been explicitly shared by the creator. This link will exist for a limited period of time, which depends on how often it is visited.)</span></p>', "\n";
0 commit comments