2 class Pman_MTrack_Diff extends Pman {
6 die("nothing here yet");
10 static function toHTML($input)
15 if (is_resource($input)) {
17 while (($line = fgets($input)) !== false) {
18 $lines[] = rtrim($line, "\r\n");
24 if (is_string($input)) {
26 $input = preg_split("/\r?\n/", $input);
28 $abase = md5(join("\n", $input));
40 $line = array_shift($input);
43 if (!strncmp($line, '@@ ', 3)) {
44 /* done with preamble */
47 $ret[] = (object)array(
66 if (preg_match("/^@@\s+-(\pN+)(?:,\pN+)?\s+\+(\pN+)(?:,\pN+)?\s*@@/",
68 $lines[0] = (int)$M[1] - 1;
69 $lines[1] = (int)$M[2] - 1;
73 } else if (preg_match("/^diff /", $line)) {
77 } elseif (strlen($line)) {
78 if ($line[0] == '-') {
81 } elseif ($line[0] == '+') {
102 if ($class != 'meta' && $first) {
107 $anchor = $abase . '.' . $nlines;
108 $add = (object)array(
110 'line' => $class == 'meta' ? $line : substr($line, 1),
111 'meta' => $class == 'meta',
113 'anchor' => $class == 'meta' ? $anchor : false
121 if (!count($input)) {
124 $line = array_shift($input);