19 $this->lines = explode(
"\n", $text );
20 $this->numLines = count( $this->lines );
29 while ( $this->pos < $this->numLines ) {
37 case 'transparenthooks':
41 if ( $this->pos < $this->numLines - 1 ) {
48 foreach ( $this->deletions
as $deletion => $unused ) {
49 $this->
warning(
"Could not find test \"$deletion\" to delete it" );
51 foreach ( $this->changes
as $test => $sectionChanges ) {
52 foreach ( $sectionChanges
as $section => $change ) {
53 $this->
warning(
"Could not find section \"$section\" in test \"$test\" " .
54 "to {$change['op']} it" );
67 if ( preg_match(
'/^!!\s*(\S+)/',
$line, $m ) ) {
76 $line = $this->lines[$this->pos++];
80 'headingLine' =>
$line,
84 while ( $this->pos < $this->numLines ) {
85 $line = $this->lines[$this->pos++];
87 if ( $nextHeading ===
'end' ) {
92 for ( $i = 0; $i < $this->numLines - $this->pos - 1; $i++ ) {
93 if ( $this->lines[$this->pos + $i] ===
'' ) {
99 $this->pos += strlen( $trail );
103 'headingLine' =>
$line,
108 } elseif ( $nextHeading !==
false ) {
110 $heading = $nextHeading;
113 'headingLine' =>
$line,
121 throw new Exception(
'Unexpected end of file' );
125 $line = $this->lines[$this->pos++];
127 $expectedEnd =
'end' . $heading;
128 $contents =
"$line\n";
131 $line = $this->lines[$this->pos++];
133 $contents .=
"$line\n";
134 }
while ( $this->pos < $this->numLines && $nextHeading !== $expectedEnd );
136 if ( $nextHeading !== $expectedEnd ) {
137 throw new Exception(
'Unexpected end of file' );
143 $this->result .= $contents;
149 if (
$section[
'name'] ===
'test' ) {
150 $testName = rtrim(
$section[
'contents'],
"\n" );
153 if ( isset( $this->deletions[$testName] ) ) {
155 unset( $this->deletions[$testName] );
158 if ( isset( $this->changes[$testName] ) ) {
159 $changes =& $this->changes[$testName];
162 if ( isset(
$changes[$sectionName] ) ) {
164 switch ( $change[
'op'] ) {
166 $test[$i][
'name'] = $change[
'value'];
167 $test[$i][
'headingLine'] =
"!! {$change['value']}";
170 $test[$i][
'contents'] = $change[
'value'];
173 $test[$i][
'deleted'] =
true;
176 throw new Exception(
"Unknown op: ${change['op']}" );
185 if ( isset(
$section[
'deleted'] ) ) {
188 $this->result .=
$section[
'headingLine'] .
"\n";
189 $this->result .=
$section[
'contents'];
194 $this->result .= $contents;
__construct( $text, array $deletions, array $changes, $warningCallback)
static edit( $text, array $deletions, array $changes, $warningCallback=null)
emitHooks( $heading, $contents)
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
passed in as a query string parameter to the various URLs constructed here(i.e. $prevlink) $ldel you ll need to handle error etc yourself modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext Return true without altering $error to allow the edit to proceed & $editor
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))