Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -9,8 +9,6 @@ |
10 | 10 | // You may copy this code freely under the conditions of the GPL. |
11 | 11 | // |
12 | 12 | |
13 | | -define('USE_ASSERTS', function_exists('assert')); |
14 | | - |
15 | 13 | /** |
16 | 14 | * @todo document |
17 | 15 | * @private |
— | — | @@ -153,8 +151,8 @@ |
154 | 152 | $edits = array(); |
155 | 153 | $xi = $yi = 0; |
156 | 154 | while ($xi < $n_from || $yi < $n_to) { |
157 | | - USE_ASSERTS && assert($yi < $n_to || $this->xchanged[$xi]); |
158 | | - USE_ASSERTS && assert($xi < $n_from || $this->ychanged[$yi]); |
| 155 | + assert($yi < $n_to || $this->xchanged[$xi]); |
| 156 | + assert($xi < $n_from || $this->ychanged[$yi]); |
159 | 157 | |
160 | 158 | // Skip matching "snake". |
161 | 159 | $copy = array(); |
— | — | @@ -316,13 +314,13 @@ |
317 | 315 | while (list ($junk, $y) = each($matches)) |
318 | 316 | if (empty($this->in_seq[$y])) { |
319 | 317 | $k = $this->_lcs_pos($y); |
320 | | - USE_ASSERTS && assert($k > 0); |
| 318 | + assert($k > 0); |
321 | 319 | $ymids[$k] = $ymids[$k-1]; |
322 | 320 | break; |
323 | 321 | } |
324 | 322 | while (list ( /* $junk */, $y) = each($matches)) { |
325 | 323 | if ($y > $this->seq[$k-1]) { |
326 | | - USE_ASSERTS && assert($y < $this->seq[$k]); |
| 324 | + assert($y < $this->seq[$k]); |
327 | 325 | // Optimization: this is a common case: |
328 | 326 | // next match is just replacing previous match. |
329 | 327 | $this->in_seq[$this->seq[$k]] = false; |
— | — | @@ -330,7 +328,7 @@ |
331 | 329 | $this->in_seq[$y] = 1; |
332 | 330 | } else if (empty($this->in_seq[$y])) { |
333 | 331 | $k = $this->_lcs_pos($y); |
334 | | - USE_ASSERTS && assert($k > 0); |
| 332 | + assert($k > 0); |
335 | 333 | $ymids[$k] = $ymids[$k-1]; |
336 | 334 | } |
337 | 335 | } |
— | — | @@ -366,7 +364,7 @@ |
367 | 365 | $end = $mid; |
368 | 366 | } |
369 | 367 | |
370 | | - USE_ASSERTS && assert($ypos != $this->seq[$end]); |
| 368 | + assert($ypos != $this->seq[$end]); |
371 | 369 | |
372 | 370 | $this->in_seq[$this->seq[$end]] = false; |
373 | 371 | $this->seq[$end] = $ypos; |
— | — | @@ -446,7 +444,7 @@ |
447 | 445 | $i = 0; |
448 | 446 | $j = 0; |
449 | 447 | |
450 | | - USE_ASSERTS && assert('sizeof($lines) == sizeof($changed)'); |
| 448 | + assert('sizeof($lines) == sizeof($changed)'); |
451 | 449 | $len = sizeof($lines); |
452 | 450 | $other_len = sizeof($other_changed); |
453 | 451 | |
— | — | @@ -466,7 +464,7 @@ |
467 | 465 | $j++; |
468 | 466 | |
469 | 467 | while ($i < $len && ! $changed[$i]) { |
470 | | - USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); |
| 468 | + assert('$j < $other_len && ! $other_changed[$j]'); |
471 | 469 | $i++; $j++; |
472 | 470 | while ($j < $other_len && $other_changed[$j]) |
473 | 471 | $j++; |
— | — | @@ -498,10 +496,10 @@ |
499 | 497 | $changed[--$i] = false; |
500 | 498 | while ($start > 0 && $changed[$start - 1]) |
501 | 499 | $start--; |
502 | | - USE_ASSERTS && assert('$j > 0'); |
| 500 | + assert('$j > 0'); |
503 | 501 | while ($other_changed[--$j]) |
504 | 502 | continue; |
505 | | - USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); |
| 503 | + assert('$j >= 0 && !$other_changed[$j]'); |
506 | 504 | } |
507 | 505 | |
508 | 506 | /* |
— | — | @@ -524,7 +522,7 @@ |
525 | 523 | while ($i < $len && $changed[$i]) |
526 | 524 | $i++; |
527 | 525 | |
528 | | - USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); |
| 526 | + assert('$j < $other_len && ! $other_changed[$j]'); |
529 | 527 | $j++; |
530 | 528 | if ($j < $other_len && $other_changed[$j]) { |
531 | 529 | $corresponding = $i; |
— | — | @@ -541,10 +539,10 @@ |
542 | 540 | while ($corresponding < $i) { |
543 | 541 | $changed[--$start] = 1; |
544 | 542 | $changed[--$i] = 0; |
545 | | - USE_ASSERTS && assert('$j > 0'); |
| 543 | + assert('$j > 0'); |
546 | 544 | while ($other_changed[--$j]) |
547 | 545 | continue; |
548 | | - USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); |
| 546 | + assert('$j >= 0 && !$other_changed[$j]'); |
549 | 547 | } |
550 | 548 | } |
551 | 549 | wfProfileOut( __METHOD__ ); |
Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -197,16 +197,12 @@ |
198 | 198 | ini_set( 'html_errors', '0' ); |
199 | 199 | set_error_handler( array( 'UserMailer', 'errorHandler' ) ); |
200 | 200 | |
201 | | - if (function_exists('mail')) { |
202 | | - if (is_array($to)) { |
203 | | - foreach ($to as $recip) { |
204 | | - $sent = mail( $recip->toString(), wfQuotedPrintable( $subject ), $body, $headers ); |
205 | | - } |
206 | | - } else { |
207 | | - $sent = mail( $to->toString(), wfQuotedPrintable( $subject ), $body, $headers ); |
| 201 | + if (is_array($to)) { |
| 202 | + foreach ($to as $recip) { |
| 203 | + $sent = mail( $recip->toString(), wfQuotedPrintable( $subject ), $body, $headers ); |
208 | 204 | } |
209 | 205 | } else { |
210 | | - self::$mErrorString = 'PHP is not configured to send mail'; |
| 206 | + $sent = mail( $to->toString(), wfQuotedPrintable( $subject ), $body, $headers ); |
211 | 207 | } |
212 | 208 | |
213 | 209 | restore_error_handler(); |
Index: trunk/phase3/includes/Math.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | | - if( function_exists( 'is_executable' ) && !is_executable( $wgTexvc ) ) { |
| 60 | + if( !is_executable( $wgTexvc ) ) { |
61 | 61 | return $this->_error( 'math_notexvc' ); |
62 | 62 | } |
63 | 63 | $cmd = $wgTexvc . ' ' . |