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" );
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 ) {
113 'headingLine' =>
$line,
121 throw new Exception(
'Unexpected end of file' );
125 $line = $this->lines[$this->pos++];
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' ) {
153 if (
isset( $this->deletions[$testName] ) ) {
155 unset( $this->deletions[$testName] );
158 if (
isset( $this->changes[$testName] ) ) {
159 $changes =& $this->changes[$testName];
160 foreach ( $test as $i =>
$section ) {
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']}" );
188 $this->result .=
$section[
'headingLine'] .
"\n";
189 $this->result .=
$section[
'contents'];
194 $this->result .= $contents;
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
__construct( $text, array $deletions, array $changes, $warningCallback)
static edit( $text, array $deletions, array $changes, $warningCallback=null)
emitHooks( $heading, $contents)
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
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))