@@ -51,7 +51,7 @@ |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | //require_once 'Text/Diff/Engine/' . $engine . '.php'; |
54 | - $class = 'Text_Diff_Engine_' . $engine; |
|
54 | + $class = 'Text_Diff_Engine_'.$engine; |
|
55 | 55 | $diff_engine = new $class(); |
56 | 56 | |
57 | 57 | $this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | function _getTempDir() |
228 | 228 | { |
229 | 229 | $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp', |
230 | - 'c:\windows\temp', 'c:\winnt\temp'); |
|
230 | + 'c:\windows\temp', 'c:\winnt\temp'); |
|
231 | 231 | |
232 | 232 | /* Try PHP's upload_tmp_dir directive. */ |
233 | 233 | $tmp = ini_get('upload_tmp_dir'); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * of elements as $to_lines. |
310 | 310 | */ |
311 | 311 | function Text_MappedDiff($from_lines, $to_lines, |
312 | - $mapped_from_lines, $mapped_to_lines) |
|
312 | + $mapped_from_lines, $mapped_to_lines) |
|
313 | 313 | { |
314 | 314 | assert(count($from_lines) == count($mapped_from_lines)); |
315 | 315 | assert(count($to_lines) == count($mapped_to_lines)); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $this->_edits = $this->_diff3($engine->diff($orig, $final1), |
49 | - $engine->diff($orig, $final2)); |
|
49 | + $engine->diff($orig, $final2)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | if ($edit->isConflict()) { |
59 | 59 | /* FIXME: this should probably be moved somewhere else. */ |
60 | 60 | $lines = array_merge($lines, |
61 | - array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), |
|
62 | - $edit->final1, |
|
63 | - array("======="), |
|
64 | - $edit->final2, |
|
65 | - array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); |
|
61 | + array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), |
|
62 | + $edit->final1, |
|
63 | + array("======="), |
|
64 | + $edit->final2, |
|
65 | + array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); |
|
66 | 66 | $this->_conflictingBlocks++; |
67 | 67 | } else { |
68 | 68 | $lines = array_merge($lines, $edit->merged()); |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | if ($edit->isConflict()) { |
59 | 59 | /* FIXME: this should probably be moved somewhere else. */ |
60 | 60 | $lines = array_merge($lines, |
61 | - array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), |
|
61 | + array('<<<<<<<'.($label1 ? ' '.$label1 : '')), |
|
62 | 62 | $edit->final1, |
63 | 63 | array("======="), |
64 | 64 | $edit->final2, |
65 | - array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); |
|
65 | + array('>>>>>>>'.($label2 ? ' '.$label2 : ''))); |
|
66 | 66 | $this->_conflictingBlocks++; |
67 | 67 | } else { |
68 | 68 | $lines = array_merge($lines, $edit->merged()); |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | - if ($e1 && ! $e1->orig) { |
|
129 | + if ($e1 && !$e1->orig) { |
|
130 | 130 | $bb->out1($e1->final); |
131 | 131 | $e1 = next($edits1); |
132 | 132 | } |
133 | - if ($e2 && ! $e2->orig) { |
|
133 | + if ($e2 && !$e2->orig) { |
|
134 | 134 | $bb->out2($e2->final); |
135 | 135 | $e2 = next($edits2); |
136 | 136 | } |
@@ -35,10 +35,10 @@ |
||
35 | 35 | function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
36 | 36 | { |
37 | 37 | if ($xlen != 1) { |
38 | - $xbeg .= ',' . $xlen; |
|
38 | + $xbeg .= ','.$xlen; |
|
39 | 39 | } |
40 | 40 | if ($ylen != 1) { |
41 | - $ybeg .= ',' . $ylen; |
|
41 | + $ybeg .= ','.$ylen; |
|
42 | 42 | } |
43 | 43 | $this->_second_block = "--- $ybeg ----\n"; |
44 | 44 | return "***************\n*** $xbeg ****"; |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
35 | 35 | { |
36 | 36 | if ($xlen != 1) { |
37 | - $xbeg .= ',' . $xlen; |
|
37 | + $xbeg .= ','.$xlen; |
|
38 | 38 | } |
39 | 39 | if ($ylen != 1) { |
40 | - $ybeg .= ',' . $ylen; |
|
40 | + $ybeg .= ','.$ylen; |
|
41 | 41 | } |
42 | 42 | return "@@ -$xbeg +$ybeg @@"; |
43 | 43 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | function _changed($orig, $final) |
61 | 61 | { |
62 | - return $this->_deleted($orig) . $this->_added($final); |
|
62 | + return $this->_deleted($orig).$this->_added($final); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * of elements as $to_lines. |
30 | 30 | */ |
31 | 31 | function Text_Diff_Mapped($from_lines, $to_lines, |
32 | - $mapped_from_lines, $mapped_to_lines) |
|
32 | + $mapped_from_lines, $mapped_to_lines) |
|
33 | 33 | { |
34 | 34 | assert(count($from_lines) == count($mapped_from_lines)); |
35 | 35 | assert(count($to_lines) == count($mapped_to_lines)); |
@@ -46,17 +46,17 @@ |
||
46 | 46 | continue; |
47 | 47 | } |
48 | 48 | switch ($line[0]) { |
49 | - case ' ': |
|
50 | - $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); |
|
51 | - break; |
|
49 | + case ' ': |
|
50 | + $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); |
|
51 | + break; |
|
52 | 52 | |
53 | - case '+': |
|
54 | - $edits[] = &new Text_Diff_Op_add(array(substr($line, 1))); |
|
55 | - break; |
|
53 | + case '+': |
|
54 | + $edits[] = &new Text_Diff_Op_add(array(substr($line, 1))); |
|
55 | + break; |
|
56 | 56 | |
57 | - case '-': |
|
58 | - $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1))); |
|
59 | - break; |
|
57 | + case '-': |
|
58 | + $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1))); |
|
59 | + break; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 |
@@ -124,9 +124,9 @@ |
||
124 | 124 | array_push($edits, |
125 | 125 | new Text_Diff_Op_copy( |
126 | 126 | $this->_getLines($from_lines, $from_line_no, |
127 | - $from_line_no + count($from_lines) - 1), |
|
127 | + $from_line_no + count($from_lines) - 1), |
|
128 | 128 | $this->_getLines($to_lines, $to_line_no, |
129 | - $to_line_no + count($to_lines) - 1))); |
|
129 | + $to_line_no + count($to_lines) - 1))); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $edits; |
@@ -93,29 +93,29 @@ |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | switch ($match[3]) { |
96 | - case 'd': |
|
97 | - // deleted lines |
|
98 | - array_push($edits, |
|
99 | - new Text_Diff_Op_delete( |
|
100 | - $this->_getLines($from_lines, $from_line_no, $match[2]))); |
|
101 | - $to_line_no++; |
|
102 | - break; |
|
103 | - |
|
104 | - case 'c': |
|
105 | - // changed lines |
|
106 | - array_push($edits, |
|
107 | - new Text_Diff_Op_change( |
|
108 | - $this->_getLines($from_lines, $from_line_no, $match[2]), |
|
109 | - $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
110 | - break; |
|
111 | - |
|
112 | - case 'a': |
|
113 | - // added lines |
|
114 | - array_push($edits, |
|
115 | - new Text_Diff_Op_add( |
|
116 | - $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
117 | - $from_line_no++; |
|
118 | - break; |
|
96 | + case 'd': |
|
97 | + // deleted lines |
|
98 | + array_push($edits, |
|
99 | + new Text_Diff_Op_delete( |
|
100 | + $this->_getLines($from_lines, $from_line_no, $match[2]))); |
|
101 | + $to_line_no++; |
|
102 | + break; |
|
103 | + |
|
104 | + case 'c': |
|
105 | + // changed lines |
|
106 | + array_push($edits, |
|
107 | + new Text_Diff_Op_change( |
|
108 | + $this->_getLines($from_lines, $from_line_no, $match[2]), |
|
109 | + $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
110 | + break; |
|
111 | + |
|
112 | + case 'a': |
|
113 | + // added lines |
|
114 | + array_push($edits, |
|
115 | + new Text_Diff_Op_add( |
|
116 | + $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
117 | + $from_line_no++; |
|
118 | + break; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $fp = fopen($to_file, 'w'); |
50 | 50 | fwrite($fp, implode("\n", $to_lines)); |
51 | 51 | fclose($fp); |
52 | - $diff = shell_exec($this->_diffCommand . ' ' . $from_file . ' ' . $to_file); |
|
52 | + $diff = shell_exec($this->_diffCommand.' '.$from_file.' '.$to_file); |
|
53 | 53 | unlink($from_file); |
54 | 54 | unlink($to_file); |
55 | 55 |
@@ -6,17 +6,17 @@ |
||
6 | 6 | class PEAR5 |
7 | 7 | { |
8 | 8 | /** |
9 | - * If you have a class that's mostly/entirely static, and you need static |
|
10 | - * properties, you can use this method to simulate them. Eg. in your method(s) |
|
11 | - * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); |
|
12 | - * You MUST use a reference, or they will not persist! |
|
13 | - * |
|
14 | - * @access public |
|
15 | - * @param string $class The calling classname, to prevent clashes |
|
16 | - * @param string $var The variable to retrieve. |
|
17 | - * @return mixed A reference to the variable. If not set it will be |
|
18 | - * auto initialised to NULL. |
|
19 | - */ |
|
9 | + * If you have a class that's mostly/entirely static, and you need static |
|
10 | + * properties, you can use this method to simulate them. Eg. in your method(s) |
|
11 | + * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); |
|
12 | + * You MUST use a reference, or they will not persist! |
|
13 | + * |
|
14 | + * @access public |
|
15 | + * @param string $class The calling classname, to prevent clashes |
|
16 | + * @param string $var The variable to retrieve. |
|
17 | + * @return mixed A reference to the variable. If not set it will be |
|
18 | + * auto initialised to NULL. |
|
19 | + */ |
|
20 | 20 | static function &getStaticProperty($class, $var) |
21 | 21 | { |
22 | 22 | static $properties; |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | /**#@+ |
27 | 27 | * ERROR constants |
28 | 28 | */ |
29 | -define('PEAR_ERROR_RETURN', 1); |
|
30 | -define('PEAR_ERROR_PRINT', 2); |
|
31 | -define('PEAR_ERROR_TRIGGER', 4); |
|
32 | -define('PEAR_ERROR_DIE', 8); |
|
33 | -define('PEAR_ERROR_CALLBACK', 16); |
|
29 | +define('PEAR_ERROR_RETURN', 1); |
|
30 | +define('PEAR_ERROR_PRINT', 2); |
|
31 | +define('PEAR_ERROR_TRIGGER', 4); |
|
32 | +define('PEAR_ERROR_DIE', 8); |
|
33 | +define('PEAR_ERROR_CALLBACK', 16); |
|
34 | 34 | /** |
35 | 35 | * WARNING: obsolete |
36 | 36 | * @deprecated |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | |
43 | 43 | if (substr(PHP_OS, 0, 3) == 'WIN') { |
44 | 44 | define('OS_WINDOWS', true); |
45 | - define('OS_UNIX', false); |
|
46 | - define('PEAR_OS', 'Windows'); |
|
45 | + define('OS_UNIX', false); |
|
46 | + define('PEAR_OS', 'Windows'); |
|
47 | 47 | } else { |
48 | 48 | define('OS_WINDOWS', false); |
49 | - define('OS_UNIX', true); |
|
50 | - define('PEAR_OS', 'Unix'); // blatant assumption |
|
49 | + define('OS_UNIX', true); |
|
50 | + define('PEAR_OS', 'Unix'); // blatant assumption |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | // $error_code is a non-empty array here; |
452 | 452 | // we walk through it trying to unset all |
453 | 453 | // values |
454 | - foreach($error_code as $key => $error) { |
|
454 | + foreach ($error_code as $key => $error) { |
|
455 | 455 | if ($this->_checkDelExpect($error)) { |
456 | - $deleted = true; |
|
456 | + $deleted = true; |
|
457 | 457 | } else { |
458 | 458 | $deleted = false; |
459 | 459 | } |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | */ |
987 | 987 | function getMessage() |
988 | 988 | { |
989 | - return ($this->error_message_prefix . $this->message); |
|
989 | + return ($this->error_message_prefix.$this->message); |
|
990 | 990 | } |
991 | 991 | |
992 | 992 | |
@@ -1103,8 +1103,7 @@ discard block |
||
1103 | 1103 | if ($this->mode & PEAR_ERROR_CALLBACK) { |
1104 | 1104 | if (is_array($this->callback)) { |
1105 | 1105 | $callback = (is_object($this->callback[0]) ? |
1106 | - strtolower(get_class($this->callback[0])) : |
|
1107 | - $this->callback[0]) . '::' . |
|
1106 | + strtolower(get_class($this->callback[0])) : $this->callback[0]).'::'. |
|
1108 | 1107 | $this->callback[1]; |
1109 | 1108 | } else { |
1110 | 1109 | $callback = $this->callback; |
@@ -205,17 +205,17 @@ discard block |
||
205 | 205 | // {{{ getStaticProperty() |
206 | 206 | |
207 | 207 | /** |
208 | - * If you have a class that's mostly/entirely static, and you need static |
|
209 | - * properties, you can use this method to simulate them. Eg. in your method(s) |
|
210 | - * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); |
|
211 | - * You MUST use a reference, or they will not persist! |
|
212 | - * |
|
213 | - * @access public |
|
214 | - * @param string $class The calling classname, to prevent clashes |
|
215 | - * @param string $var The variable to retrieve. |
|
216 | - * @return mixed A reference to the variable. If not set it will be |
|
217 | - * auto initialised to NULL. |
|
218 | - */ |
|
208 | + * If you have a class that's mostly/entirely static, and you need static |
|
209 | + * properties, you can use this method to simulate them. Eg. in your method(s) |
|
210 | + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); |
|
211 | + * You MUST use a reference, or they will not persist! |
|
212 | + * |
|
213 | + * @access public |
|
214 | + * @param string $class The calling classname, to prevent clashes |
|
215 | + * @param string $var The variable to retrieve. |
|
216 | + * @return mixed A reference to the variable. If not set it will be |
|
217 | + * auto initialised to NULL. |
|
218 | + */ |
|
219 | 219 | function &getStaticProperty($class, $var) |
220 | 220 | { |
221 | 221 | static $properties; |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | // {{{ registerShutdownFunc() |
235 | 235 | |
236 | 236 | /** |
237 | - * Use this function to register a shutdown method for static |
|
238 | - * classes. |
|
239 | - * |
|
240 | - * @access public |
|
241 | - * @param mixed $func The function name (or array of class/method) to call |
|
242 | - * @param mixed $args The arguments to pass to the function |
|
243 | - * @return void |
|
244 | - */ |
|
237 | + * Use this function to register a shutdown method for static |
|
238 | + * classes. |
|
239 | + * |
|
240 | + * @access public |
|
241 | + * @param mixed $func The function name (or array of class/method) to call |
|
242 | + * @param mixed $args The arguments to pass to the function |
|
243 | + * @return void |
|
244 | + */ |
|
245 | 245 | function registerShutdownFunc($func, $args = array()) |
246 | 246 | { |
247 | 247 | // if we are called statically, there is a potential |
@@ -513,12 +513,12 @@ discard block |
||
513 | 513 | * @since PHP 4.0.5 |
514 | 514 | */ |
515 | 515 | function &raiseError($message = null, |
516 | - $code = null, |
|
517 | - $mode = null, |
|
518 | - $options = null, |
|
519 | - $userinfo = null, |
|
520 | - $error_class = null, |
|
521 | - $skipmsg = false) |
|
516 | + $code = null, |
|
517 | + $mode = null, |
|
518 | + $options = null, |
|
519 | + $userinfo = null, |
|
520 | + $error_class = null, |
|
521 | + $skipmsg = false) |
|
522 | 522 | { |
523 | 523 | // The error is yet a PEAR error object |
524 | 524 | if (is_object($message)) { |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | * |
585 | 585 | */ |
586 | 586 | function &throwError($message = null, |
587 | - $code = null, |
|
588 | - $userinfo = null) |
|
587 | + $code = null, |
|
588 | + $userinfo = null) |
|
589 | 589 | { |
590 | 590 | if (isset($this) && is_a($this, 'PEAR')) { |
591 | 591 | $a = &$this->raiseError($message, $code, null, null, $userinfo); |
@@ -707,12 +707,12 @@ discard block |
||
707 | 707 | // {{{ popErrorHandling() |
708 | 708 | |
709 | 709 | /** |
710 | - * Pop the last error handler used |
|
711 | - * |
|
712 | - * @return bool Always true |
|
713 | - * |
|
714 | - * @see PEAR::pushErrorHandling |
|
715 | - */ |
|
710 | + * Pop the last error handler used |
|
711 | + * |
|
712 | + * @return bool Always true |
|
713 | + * |
|
714 | + * @see PEAR::pushErrorHandling |
|
715 | + */ |
|
716 | 716 | function popErrorHandling() |
717 | 717 | { |
718 | 718 | $stack = &$GLOBALS['_PEAR_error_handler_stack']; |
@@ -731,12 +731,12 @@ discard block |
||
731 | 731 | // {{{ loadExtension() |
732 | 732 | |
733 | 733 | /** |
734 | - * OS independant PHP extension load. Remember to take care |
|
735 | - * on the correct extension name for case sensitive OSes. |
|
736 | - * |
|
737 | - * @param string $ext The extension name |
|
738 | - * @return bool Success or not on the dl() call |
|
739 | - */ |
|
734 | + * OS independant PHP extension load. Remember to take care |
|
735 | + * on the correct extension name for case sensitive OSes. |
|
736 | + * |
|
737 | + * @param string $ext The extension name |
|
738 | + * @return bool Success or not on the dl() call |
|
739 | + */ |
|
740 | 740 | function loadExtension($ext) |
741 | 741 | { |
742 | 742 | if (!extension_loaded($ext)) { |
@@ -999,10 +999,10 @@ discard block |
||
999 | 999 | * @return int error code |
1000 | 1000 | * @access public |
1001 | 1001 | */ |
1002 | - function getCode() |
|
1003 | - { |
|
1002 | + function getCode() |
|
1003 | + { |
|
1004 | 1004 | return $this->code; |
1005 | - } |
|
1005 | + } |
|
1006 | 1006 | |
1007 | 1007 | // }}} |
1008 | 1008 | // {{{ getType() |
@@ -1110,10 +1110,10 @@ discard block |
||
1110 | 1110 | $callback = $this->callback; |
1111 | 1111 | } |
1112 | 1112 | return sprintf('[%s: message="%s" code=%d mode=callback '. |
1113 | - 'callback=%s prefix="%s" info="%s"]', |
|
1114 | - strtolower(get_class($this)), $this->message, $this->code, |
|
1115 | - $callback, $this->error_message_prefix, |
|
1116 | - $this->userinfo); |
|
1113 | + 'callback=%s prefix="%s" info="%s"]', |
|
1114 | + strtolower(get_class($this)), $this->message, $this->code, |
|
1115 | + $callback, $this->error_message_prefix, |
|
1116 | + $this->userinfo); |
|
1117 | 1117 | } |
1118 | 1118 | if ($this->mode & PEAR_ERROR_PRINT) { |
1119 | 1119 | $modes[] = 'print'; |
@@ -1128,11 +1128,11 @@ discard block |
||
1128 | 1128 | $modes[] = 'return'; |
1129 | 1129 | } |
1130 | 1130 | return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. |
1131 | - 'prefix="%s" info="%s"]', |
|
1132 | - strtolower(get_class($this)), $this->message, $this->code, |
|
1133 | - implode("|", $modes), $levels[$this->level], |
|
1134 | - $this->error_message_prefix, |
|
1135 | - $this->userinfo); |
|
1131 | + 'prefix="%s" info="%s"]', |
|
1132 | + strtolower(get_class($this)), $this->message, $this->code, |
|
1133 | + implode("|", $modes), $levels[$this->level], |
|
1134 | + $this->error_message_prefix, |
|
1135 | + $this->userinfo); |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | // }}} |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, |
491 | 491 | * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. |
492 | 492 | * |
493 | - * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter |
|
493 | + * @param integer|null $options If $mode is PEAR_ERROR_TRIGGER, this parameter |
|
494 | 494 | * specifies the PHP-internal error level (one of |
495 | 495 | * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). |
496 | 496 | * If $mode is PEAR_ERROR_CALLBACK, this |
@@ -581,6 +581,7 @@ discard block |
||
581 | 581 | * message, code and userinfo are enough. |
582 | 582 | * |
583 | 583 | * @param string $message |
584 | + * @param integer $code |
|
584 | 585 | * |
585 | 586 | */ |
586 | 587 | function &throwError($message = null, |