76 if ( array_key_exists( $i, $this->closing ) ) {
77 return $this->closing[$i];
88 return $this->orig ? count( $this->orig ) : 0;
95 return $this->closing ? count( $this->closing ) : 0;
121 return new DiffOpCopy( $this->closing, $this->orig );
137 $this->closing =
false;
224 $this->
edits = $eng->diff( $from_lines, $to_lines );
249 foreach ( $this->
edits as $edit ) {
250 $rev->edits[] = $edit->reverse();
262 foreach ( $this->
edits as $edit ) {
263 if ( $edit->type !=
'copy' ) {
280 foreach ( $this->
edits as $edit ) {
281 if ( $edit->type ==
'copy' ) {
282 $lcs += count( $edit->orig );
300 foreach ( $this->
edits as $edit ) {
302 array_splice(
$lines, count(
$lines ), 0, $edit->orig );
320 foreach ( $this->
edits as $edit ) {
321 if ( $edit->closing ) {
322 array_splice(
$lines, count(
$lines ), 0, $edit->closing );
This diff implementation is mainly lifted from the LCS algorithm of the Eclipse project which in turn...
setBailoutComplexity( $value)
Sets the complexity (in comparison operations) that can't be exceeded.
__construct( $orig, $closing)
__construct( $orig, $closing=false)
The base class for all other DiffOp classes.
Class representing a 'diff' between two sequences of strings.
int $bailoutComplexity
If this diff complexity is exceeded, a ComplexityException is thrown 0 means no limit.
reverse()
Compute reversed Diff.
orig()
Get the original set of lines.
isEmpty()
Check for empty diff.
lcs()
Compute the length of the Longest Common Subsequence (LCS).
closing()
Get the closing set of lines.
__construct( $from_lines, $to_lines)
Computes diff between sequences of strings.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if so it s not worth the trouble Since there is a job queue in the jobs which is used to update link tables of transcluding pages after edits
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php