Changeset 28525 for trunk/src/wp-includes/wp-diff.php
- Timestamp:
- 05/19/2014 03:22:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-diff.php
r26051 r28525 29 29 * @see Text_Diff_Renderer::_leading_context_lines 30 30 * @var int 31 * @access p rotected32 * @since 2.6.0 33 */ 34 var$_leading_context_lines = 10000;31 * @access public 32 * @since 2.6.0 33 */ 34 public $_leading_context_lines = 10000; 35 35 36 36 /** 37 37 * @see Text_Diff_Renderer::_trailing_context_lines 38 38 * @var int 39 * @access p rotected40 * @since 2.6.0 41 */ 42 var$_trailing_context_lines = 10000;39 * @access public 40 * @since 2.6.0 41 */ 42 public $_trailing_context_lines = 10000; 43 43 44 44 /** … … 49 49 * @since 2.6.0 50 50 */ 51 var$_diff_threshold = 0.6;51 protected $_diff_threshold = 0.6; 52 52 53 53 /** … … 58 58 * @since 2.6.0 59 59 */ 60 var$inline_diff_renderer = 'WP_Text_Diff_Renderer_inline';60 protected $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline'; 61 61 62 62 /** … … 67 67 * @since 3.6.0 68 68 */ 69 var$_show_split_view = true;69 protected $_show_split_view = true; 70 70 71 71 /** … … 78 78 * @param array $params 79 79 */ 80 function __construct( $params = array() ) {80 public function __construct( $params = array() ) { 81 81 parent::__construct( $params ); 82 82 if ( isset( $params[ 'show_split_view' ] ) ) … … 90 90 * @return string 91 91 */ 92 function _startBlock( $header ) {92 public function _startBlock( $header ) { 93 93 return ''; 94 94 } … … 100 100 * @param string $prefix 101 101 */ 102 function _lines( $lines, $prefix=' ' ) {102 public function _lines( $lines, $prefix=' ' ) { 103 103 } 104 104 … … 109 109 * @return string 110 110 */ 111 function addedLine( $line ) {111 public function addedLine( $line ) { 112 112 return "<td class='diff-addedline'>{$line}</td>"; 113 113 … … 120 120 * @return string 121 121 */ 122 function deletedLine( $line ) {122 public function deletedLine( $line ) { 123 123 return "<td class='diff-deletedline'>{$line}</td>"; 124 124 } … … 130 130 * @return string 131 131 */ 132 function contextLine( $line ) {132 public function contextLine( $line ) { 133 133 return "<td class='diff-context'>{$line}</td>"; 134 134 } … … 139 139 * @return string 140 140 */ 141 function emptyLine() {141 public function emptyLine() { 142 142 return '<td> </td>'; 143 143 } … … 145 145 /** 146 146 * @ignore 147 * @access p rivate147 * @access public 148 148 * 149 149 * @param array $lines … … 151 151 * @return string 152 152 */ 153 function _added( $lines, $encode = true ) {153 public function _added( $lines, $encode = true ) { 154 154 $r = ''; 155 155 foreach ($lines as $line) { … … 167 167 /** 168 168 * @ignore 169 * @access p rivate169 * @access public 170 170 * 171 171 * @param array $lines … … 173 173 * @return string 174 174 */ 175 function _deleted( $lines, $encode = true ) {175 public function _deleted( $lines, $encode = true ) { 176 176 $r = ''; 177 177 foreach ($lines as $line) { … … 190 190 /** 191 191 * @ignore 192 * @access p rivate192 * @access public 193 193 * 194 194 * @param array $lines … … 196 196 * @return string 197 197 */ 198 function _context( $lines, $encode = true ) {198 public function _context( $lines, $encode = true ) { 199 199 $r = ''; 200 200 foreach ($lines as $line) { … … 216 216 * We do additional processing to figure that out 217 217 * 218 * @access p rivate218 * @access public 219 219 * @since 2.6.0 220 220 * … … 223 223 * @return string 224 224 */ 225 function _changed( $orig, $final ) {225 public function _changed( $orig, $final ) { 226 226 $r = ''; 227 227 … … 314 314 * @return unknown 315 315 */ 316 function interleave_changed_lines( $orig, $final ) {316 public function interleave_changed_lines( $orig, $final ) { 317 317 318 318 // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array. … … 403 403 * @return int 404 404 */ 405 function compute_string_distance( $string1, $string2 ) {405 public function compute_string_distance( $string1, $string2 ) { 406 406 // Vectors containing character frequency for all chars in each string 407 407 $chars1 = count_chars($string1); … … 427 427 * @return int 428 428 */ 429 function difference( $a, $b ) {429 public function difference( $a, $b ) { 430 430 return abs( $a - $b ); 431 431 } 432 432 433 /** 434 * Make private properties readable for backwards compatibility 435 * 436 * @since 4.0.0 437 * @param string $name 438 * @return mixed 439 */ 440 public function __get( $name ) { 441 return $this->$name; 442 } 443 444 /** 445 * Make private properties setable for backwards compatibility 446 * 447 * @since 4.0.0 448 * @param string $name 449 * @param string $value 450 * @return mixed 451 */ 452 public function __set( $name, $value ) { 453 return $this->$name = $value; 454 } 455 456 /** 457 * Make private properties checkable for backwards compatibility 458 * 459 * @since 4.0.0 460 * @param string $name 461 * @return mixed 462 */ 463 public function __isset( $name ) { 464 return isset( $this->$name ); 465 } 466 467 /** 468 * Make private properties unsetable for backwards compatibility 469 * 470 * @since 4.0.0 471 * @param string $name 472 * @return mixed 473 */ 474 public function __unset( $name ) { 475 unset( $this->$name ); 476 } 477 478 /** 479 * Make private/protected methods readable for backwards compatibility 480 * 481 * @since 4.0.0 482 * @param string $name 483 * @param array $arguments 484 * @return mixed 485 */ 486 public function __call( $name, $arguments ) { 487 return call_user_func_array( array( $this, $name ), $arguments ); 488 } 433 489 } 434 490 … … 449 505 * @return string 450 506 */ 451 function _splitOnWords($string, $newlineEscape = "\n") {507 public function _splitOnWords($string, $newlineEscape = "\n") { 452 508 $string = str_replace("\0", '', $string); 453 509 $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
Note: See TracChangeset
for help on using the changeset viewer.