Advertisement
Guest User

Untitled

a guest
Sep 14th, 2015
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. From d26beae10d6d2f0401900a94599d866b9d201c2b Mon Sep 17 00:00:00 2001
  2. From: Alangi Derick <alangiderick@gmail.com>
  3. Date: Mon, 14 Sep 2015 10:47:28 +0100
  4. Subject: [PATCH] Deprecated function wfDiff() in GlobalFunctions.php
  5.  
  6. Trying to fix the bugs about deprecated functions in GlobalFunctions.php. I have just fixed this one and wfDiff()
  7. is still called in different files. I will have to modify them too.
  8.  
  9. Signed-off-by: Alangi Derick <alangiderick@gmail.com>
  10. ---
  11.  includes/GlobalFunctions.php       | 1 +
  12.  includes/parser/ParserDiffTest.php | 5 ++++-
  13.  2 files changed, 5 insertions(+), 1 deletion(-)
  14.  
  15. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
  16. index 2852561..9e99f8a 100755
  17. --- a/includes/GlobalFunctions.php
  18. +++ b/includes/GlobalFunctions.php
  19. @@ -3104,6 +3104,7 @@ function wfMerge( $old, $mine, $yours, &$result ) {
  20.   * @return string Unified diff of $before and $after
  21.   */
  22.  function wfDiff( $before, $after, $params = '-u' ) {
  23. +   wfDeprecated( __METHOD__, '1.25');
  24.     if ( $before == $after ) {
  25.         return '';
  26.     }
  27. diff --git a/includes/parser/ParserDiffTest.php b/includes/parser/ParserDiffTest.php
  28. index 32f5d06..9fdd6eb 100755
  29. --- a/includes/parser/ParserDiffTest.php
  30. +++ b/includes/parser/ParserDiffTest.php
  31. @@ -87,7 +87,10 @@ class ParserDiffTest
  32.                 foreach ( $this->parsers as $i => $parser ) {
  33.                     $resultsList[] = var_export( $results[$i], true );
  34.                 }
  35. -               $diff = wfDiff( $resultsList[0], $resultsList[1] );
  36. +               //$diff = wfDiff( $resultsList[0], $resultsList[1] );
  37. +               $diffs = new Diff( explode( "\n", $resultsList[0] ), explode( "\n", $resultsList[1] ) );
  38. +               $diff = new UnifiedDiffFormatter();
  39. +               $format->format( $diff );
  40.             } else {
  41.                 $diff = '[too many parsers]';
  42.             }
  43. --
  44. 1.9.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement