mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Xomw: Add more implementation for XomwMessage
This commit is contained in:
parent
67787c720a
commit
3023353154
@ -4071,14 +4071,14 @@ public class XomwDefaultSettings {
|
|||||||
// * intermixed, could place NS_MAIN and NS_PROJECT namespaces in this array.
|
// * intermixed, could place NS_MAIN and NS_PROJECT namespaces in this array.
|
||||||
// */
|
// */
|
||||||
// $wgExtraSignatureNamespaces = [];
|
// $wgExtraSignatureNamespaces = [];
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * Max number of redirects to follow when resolving redirects.
|
* Max number of redirects to follow when resolving redirects.
|
||||||
// * 1 means only the first redirect is followed (default behavior).
|
* 1 means only the first redirect is followed (default behavior).
|
||||||
// * 0 or less means no redirects are followed.
|
* 0 or less means no redirects are followed.
|
||||||
// */
|
*/
|
||||||
// $wgMaxRedirects = 1;
|
public static final int wgMaxRedirects = 1;
|
||||||
//
|
|
||||||
// /**
|
// /**
|
||||||
// * Array of invalid page redirect targets.
|
// * Array of invalid page redirect targets.
|
||||||
// * Attempting to create a redirect to any of the pages in this array
|
// * Attempting to create a redirect to any of the pages in this array
|
||||||
|
@ -15,6 +15,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
|||||||
*/
|
*/
|
||||||
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
|
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
|
||||||
import gplx.xowa.mediawiki.languages.*;
|
import gplx.xowa.mediawiki.languages.*;
|
||||||
|
import gplx.xowa.mediawiki.includes.content.*;
|
||||||
/**
|
/**
|
||||||
* The Message cls provides methods which fulfil two basic services:
|
* The Message cls provides methods which fulfil two basic services:
|
||||||
* - fetching interfaceIsUserLang messages
|
* - fetching interfaceIsUserLang messages
|
||||||
@ -59,7 +60,7 @@ import gplx.xowa.mediawiki.languages.*;
|
|||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
* wfMessage( 'welcome-to' )
|
* wfMessage( 'welcome-to' )
|
||||||
* -> $wgSitename )
|
* ->prmsVar( $wgSitename )
|
||||||
* ->text();
|
* ->text();
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
@ -162,6 +163,8 @@ public class XomwMessage {
|
|||||||
/** Transform {{..}} constructs, HTML-escape the result */
|
/** Transform {{..}} constructs, HTML-escape the result */
|
||||||
private static final int FORMAT_ESCAPED = 4; // 'escaped';
|
private static final int FORMAT_ESCAPED = 4; // 'escaped';
|
||||||
|
|
||||||
|
private static final int FORMAT_NULL = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from Message::listParam() types to Language methods.
|
* Mapping from Message::listParam() types to Language methods.
|
||||||
* @var array
|
* @var array
|
||||||
@ -192,10 +195,10 @@ public class XomwMessage {
|
|||||||
* @var String The message key. If $keysToTry has more than one element,
|
* @var String The message key. If $keysToTry has more than one element,
|
||||||
* this may change to one of the keys to try when fetching the message text.
|
* this may change to one of the keys to try when fetching the message text.
|
||||||
*/
|
*/
|
||||||
private String key;
|
private byte[] key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var String... List of keys to try when fetching the message.
|
* @var String[] List of keys to try when fetching the message.
|
||||||
*/
|
*/
|
||||||
private String[] keysToTry;
|
private String[] keysToTry;
|
||||||
|
|
||||||
@ -223,7 +226,7 @@ public class XomwMessage {
|
|||||||
/**
|
/**
|
||||||
* @var Content Content Object representing the message.
|
* @var Content Content Object representing the message.
|
||||||
*/
|
*/
|
||||||
// protected $content = null;
|
// private XomwContent content = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var String
|
* @var String
|
||||||
@ -246,18 +249,18 @@ public class XomwMessage {
|
|||||||
// * @param String|String[]|MessageSpecifier key Message key, or array of
|
// * @param String|String[]|MessageSpecifier key Message key, or array of
|
||||||
// * message keys to try and use the first non-empty message for, or a
|
// * message keys to try and use the first non-empty message for, or a
|
||||||
// * MessageSpecifier to copy from.
|
// * MessageSpecifier to copy from.
|
||||||
// * @param array $params Message parameters.
|
// * @param array $prmsVar Message parameters.
|
||||||
// * @param Language $language [optional] Language to use (defaults to current user language).
|
// * @param Language $language [optional] Language to use (defaults to current user language).
|
||||||
// * @throws InvalidArgumentException
|
// * @throws InvalidArgumentException
|
||||||
// */
|
// */
|
||||||
// public function __construct( key, $params = [], Language $language = null ) {
|
// public function __construct( key, $prmsVar = [], Language $language = null ) {
|
||||||
// if ( key instanceof MessageSpecifier ) {
|
// if ( key instanceof MessageSpecifier ) {
|
||||||
// if ( $params ) {
|
// if ( $prmsVar ) {
|
||||||
// throw new InvalidArgumentException(
|
// throw new InvalidArgumentException(
|
||||||
// '$params must be empty if key is a MessageSpecifier'
|
// '$prmsVar must be empty if key is a MessageSpecifier'
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// $params = key->getParams();
|
// $prmsVar = key->getParams();
|
||||||
// key = key->getKey();
|
// key = key->getKey();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -273,7 +276,7 @@ public class XomwMessage {
|
|||||||
//
|
//
|
||||||
// $this->key = reset( $this->keysToTry );
|
// $this->key = reset( $this->keysToTry );
|
||||||
//
|
//
|
||||||
// $this->parameters = array_values( $params );
|
// $this->parameters = array_values( $prmsVar );
|
||||||
// // User language is only resolved in getLanguage(). This helps preserve the
|
// // User language is only resolved in getLanguage(). This helps preserve the
|
||||||
// // semantic intent of "user language" across serialize() and unserialize().
|
// // semantic intent of "user language" across serialize() and unserialize().
|
||||||
// $this->language = $language ?: false;
|
// $this->language = $language ?: false;
|
||||||
@ -398,14 +401,14 @@ public class XomwMessage {
|
|||||||
// * @return Message
|
// * @return Message
|
||||||
// */
|
// */
|
||||||
// public static function newFromKey( key /*...*/ ) {
|
// public static function newFromKey( key /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// array_shift( $params );
|
// array_shift( $prmsVar );
|
||||||
// return new self( key, $params );
|
// return new self( key, $prmsVar );
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Transform a MessageSpecifier or a primitive value used interchangeably with
|
// * Transform a MessageSpecifier or a primitive value used interchangeably with
|
||||||
// * specifiers (a message key String, or a key + params array) into a proper Message.
|
// * specifiers (a message key String, or a key + prmsVar array) into a proper Message.
|
||||||
// *
|
// *
|
||||||
// * Also accepts a MessageSpecifier inside an array: that's not considered a valid format
|
// * Also accepts a MessageSpecifier inside an array: that's not considered a valid format
|
||||||
// * but is an easy error to make due to how StatusValue stores messages internally.
|
// * but is an easy error to make due to how StatusValue stores messages internally.
|
||||||
@ -417,10 +420,10 @@ public class XomwMessage {
|
|||||||
// * @since 1.27
|
// * @since 1.27
|
||||||
// */
|
// */
|
||||||
// public static function newFromSpecifier( $value ) {
|
// public static function newFromSpecifier( $value ) {
|
||||||
// $params = [];
|
// $prmsVar = [];
|
||||||
// if ( is_array( $value ) ) {
|
// if ( is_array( $value ) ) {
|
||||||
// $params = $value;
|
// $prmsVar = $value;
|
||||||
// $value = array_shift( $params );
|
// $value = array_shift( $prmsVar );
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if ( $value instanceof Message ) { // Message, RawMessage, ApiMessage, etc
|
// if ( $value instanceof Message ) { // Message, RawMessage, ApiMessage, etc
|
||||||
@ -428,7 +431,7 @@ public class XomwMessage {
|
|||||||
// } elseif ( $value instanceof MessageSpecifier ) {
|
// } elseif ( $value instanceof MessageSpecifier ) {
|
||||||
// $message = new Message( $value );
|
// $message = new Message( $value );
|
||||||
// } elseif ( is_string( $value ) ) {
|
// } elseif ( is_string( $value ) ) {
|
||||||
// $message = new Message( $value, $params );
|
// $message = new Message( $value, $prmsVar );
|
||||||
// } else {
|
// } else {
|
||||||
// throw new InvalidArgumentException( __METHOD__ . ': invalid argument type '
|
// throw new InvalidArgumentException( __METHOD__ . ': invalid argument type '
|
||||||
// . gettype( $value ) );
|
// . gettype( $value ) );
|
||||||
@ -498,7 +501,7 @@ public class XomwMessage {
|
|||||||
// *
|
// *
|
||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function params( /*...*/ ) {
|
// public function prmsVar( /*...*/ ) {
|
||||||
// $args = func_get_args();
|
// $args = func_get_args();
|
||||||
//
|
//
|
||||||
// // If $args has only one entry and it's an array, then it's either a
|
// // If $args has only one entry and it's an array, then it's either a
|
||||||
@ -530,17 +533,17 @@ public class XomwMessage {
|
|||||||
// *
|
// *
|
||||||
// * @since 1.17
|
// * @since 1.17
|
||||||
// *
|
// *
|
||||||
// * @param mixed $params,... Raw parameters as strings, or a single argument that is
|
// * @param mixed $prmsVar,... Raw parameters as strings, or a single argument that is
|
||||||
// * an array of raw parameters.
|
// * an array of raw parameters.
|
||||||
// *
|
// *
|
||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function rawParams( /*...*/ ) {
|
// public function rawParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::rawParam( $param );
|
// $this->parameters[] = self::rawParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -558,11 +561,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function numParams( /*...*/ ) {
|
// public function numParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::numParam( $param );
|
// $this->parameters[] = self::numParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -580,11 +583,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function durationParams( /*...*/ ) {
|
// public function durationParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::durationParam( $param );
|
// $this->parameters[] = self::durationParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -602,11 +605,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function expiryParams( /*...*/ ) {
|
// public function expiryParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::expiryParam( $param );
|
// $this->parameters[] = self::expiryParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -624,11 +627,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function timeperiodParams( /*...*/ ) {
|
// public function timeperiodParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::timeperiodParam( $param );
|
// $this->parameters[] = self::timeperiodParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -646,11 +649,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function sizeParams( /*...*/ ) {
|
// public function sizeParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::sizeParam( $param );
|
// $this->parameters[] = self::sizeParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -668,11 +671,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function bitrateParams( /*...*/ ) {
|
// public function bitrateParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::bitrateParam( $param );
|
// $this->parameters[] = self::bitrateParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -692,11 +695,11 @@ public class XomwMessage {
|
|||||||
// * @return Message $this
|
// * @return Message $this
|
||||||
// */
|
// */
|
||||||
// public function plaintextParams( /*...*/ ) {
|
// public function plaintextParams( /*...*/ ) {
|
||||||
// $params = func_get_args();
|
// $prmsVar = func_get_args();
|
||||||
// if ( isset( $params[0] ) && is_array( $params[0] ) ) {
|
// if ( isset( $prmsVar[0] ) && is_array( $prmsVar[0] ) ) {
|
||||||
// $params = $params[0];
|
// $prmsVar = $prmsVar[0];
|
||||||
// }
|
// }
|
||||||
// foreach ( $params as $param ) {
|
// foreach ( $prmsVar as $param ) {
|
||||||
// $this->parameters[] = self::plaintextParam( $param );
|
// $this->parameters[] = self::plaintextParam( $param );
|
||||||
// }
|
// }
|
||||||
// return $this;
|
// return $this;
|
||||||
@ -814,81 +817,84 @@ public class XomwMessage {
|
|||||||
// $this->title = title;
|
// $this->title = title;
|
||||||
// return $this;
|
// return $this;
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * Returns the message as a Content Object.
|
* Returns the message as a Content Object.
|
||||||
// *
|
*
|
||||||
// * @return Content
|
* @return Content
|
||||||
// */
|
*/
|
||||||
// public function content() {
|
public XomwContent contentFunc() {
|
||||||
// if ( !$this->content ) {
|
// if (this.content == null) {
|
||||||
// $this->content = new MessageContent( $this );
|
// this.content = new XomwMessageContent(this);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return $this->content;
|
// return this.content;
|
||||||
// }
|
throw Err_.new_unimplemented();
|
||||||
//
|
}
|
||||||
// /**
|
|
||||||
// * Returns the message parsed from wikitext to HTML.
|
/**
|
||||||
// *
|
* Returns the message parsed from wikitext to HTML.
|
||||||
// * @since 1.17
|
*
|
||||||
// *
|
* @since 1.17
|
||||||
// * @param String|null $format One of the FORMAT_* constants. Null means use whatever was used
|
*
|
||||||
// * the last time (this is for B/C and should be avoided).
|
* @param String|null $format One of the FORMAT_* constants. Null means use whatever was used
|
||||||
// *
|
* the last time (this is for B/C and should be avoided).
|
||||||
// * @return String HTML
|
*
|
||||||
// */
|
* @return String HTML
|
||||||
// public function toString( $format = null ) {
|
*/
|
||||||
// if ( $format === null ) {
|
|
||||||
// $ex = new LogicException( __METHOD__ . ' using implicit format: ' . $this->format );
|
// NOTE: causes issues in C# source; E2A7BC; http://www.fileformat.info/info/unicode/char/29fc/index.htm
|
||||||
// \MediaWiki\Logger\LoggerFactory::getInstance( 'message-format' )->warning(
|
private static final byte[] LeftPointingCurvedAngleBracket = Bry_.New_by_ints(226, 167, 188);
|
||||||
// $ex->getMessage(), [ 'exception' => $ex, 'format' => $this->format, 'key' => $this->key ] );
|
public byte[] toString(int format) {
|
||||||
// $format = $this->format;
|
if (format == FORMAT_NULL) {
|
||||||
// }
|
Gfo_usr_dlg_.Instance.Warn_many("", "", "toString import implicit.*; format=~{0} key=~{1}", format, key);
|
||||||
// $String = $this->fetchMessage();
|
format = this.format;
|
||||||
//
|
}
|
||||||
// if ( $String === false ) {
|
// byte[] s = this.fetchMessage();
|
||||||
// // Err on the side of safety, ensure that the output
|
byte[] s = Bry_.Empty;
|
||||||
// // is always html safe in the event the message key is
|
|
||||||
// // missing, since in that case its highly likely the
|
if (s == null) {
|
||||||
// // message key is user-controlled.
|
// Err on the side of safety, ensure that the output
|
||||||
// // '⧼' is used instead of '<' to side-step any
|
// is always html safe in the event the message key is
|
||||||
// // double-escaping issues.
|
// missing, since in that case its highly likely the
|
||||||
// // (Keep synchronised with mw.Message#toString in JS.)
|
// message key is user-controlled.
|
||||||
// return '⧼' . htmlspecialchars( $this->key ) . '⧽';
|
// LeftPointingCurvedAngleBracket is used instead of '<' to side-step any
|
||||||
// }
|
// double-escaping issues.
|
||||||
//
|
// (Keep synchronised with mw.Message#toString in JS.)
|
||||||
// # Replace $* with a list of parameters for &uselang=qqx.
|
return Bry_.Escape_html(Bry_.Add(LeftPointingCurvedAngleBracket, key, LeftPointingCurvedAngleBracket));
|
||||||
// if ( strpos( $String, '$*' ) !== false ) {
|
}
|
||||||
// $paramlist = '';
|
|
||||||
// if ( $this->parameters !== [] ) {
|
// // Replace $* with a list of parameters for &uselang=qqx.
|
||||||
// $paramlist = ': $' . implode( ', $', range( 1, count( $this->parameters ) ) );
|
// if (strpos(s, "$*") != false) {
|
||||||
|
// String paramlist = "";
|
||||||
|
// if (this.parameters != []) {
|
||||||
|
// paramlist = ": $" . implode(", $", range(1, count(this.parameters)));
|
||||||
// }
|
// }
|
||||||
// $String = str_replace( '$*', $paramlist, $String );
|
// s = str_replace("$*", paramlist, s);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// # Replace parameters before text parsing
|
// // Replace parameters before text parsing
|
||||||
// $String = $this->replaceParameters( $String, 'before', $format );
|
// s = this.replaceParameters(s, "before", format);
|
||||||
//
|
//
|
||||||
// # Maybe transform using the full parser
|
// // Maybe transform using the full parser
|
||||||
// if ( $format === self::FORMAT_PARSE ) {
|
// if (format == XomwMessage.FORMAT_PARSE) {
|
||||||
// $String = $this->parseText( $String );
|
// s = this.parseText(s);
|
||||||
// $String = Parser::stripOuterParagraph( $String );
|
// s = Parser::stripOuterParagraph(s);
|
||||||
// } elseif ( $format === self::FORMAT_BLOCK_PARSE ) {
|
// } elseif (format == XomwMessage.FORMAT_BLOCK_PARSE) {
|
||||||
// $String = $this->parseText( $String );
|
// s = this.parseText(s);
|
||||||
// } elseif ( $format === self::FORMAT_TEXT ) {
|
// } elseif (format == XomwMessage.FORMAT_TEXT) {
|
||||||
// $String = $this->transformText( $String );
|
// s = this.transformText(s);
|
||||||
// } elseif ( $format === self::FORMAT_ESCAPED ) {
|
// } elseif (format == XomwMessage.FORMAT_ESCAPED) {
|
||||||
// $String = $this->transformText( $String );
|
// s = this.transformText(s);
|
||||||
// $String = htmlspecialchars( $String, ENT_QUOTES, 'UTF-8', false );
|
// s = htmlspecialchars(s, ENT_QUOTES, "UTF-8", false);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// # Raw parameter replacement
|
// // Raw parameter replacement
|
||||||
// $String = $this->replaceParameters( $String, 'after', $format );
|
// s = this.replaceParameters(s, "after", format);
|
||||||
//
|
|
||||||
// return $String;
|
return s;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
// /**
|
||||||
// * Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg:
|
// * Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg:
|
||||||
// * $foo = new Message( key );
|
// * $foo = new Message( key );
|
||||||
@ -927,19 +933,19 @@ public class XomwMessage {
|
|||||||
// $this->format = self::FORMAT_PARSE;
|
// $this->format = self::FORMAT_PARSE;
|
||||||
// return $this->toString( self::FORMAT_PARSE );
|
// return $this->toString( self::FORMAT_PARSE );
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * Returns the message text. {{-transformation is done.
|
* Returns the message text. {{-transformation is done.
|
||||||
// *
|
*
|
||||||
// * @since 1.17
|
* @since 1.17
|
||||||
// *
|
*
|
||||||
// * @return String Unescaped message text.
|
* @return String Unescaped message text.
|
||||||
// */
|
*/
|
||||||
// public function text() {
|
public byte[] textMw() {
|
||||||
// $this->format = self::FORMAT_TEXT;
|
this.format = XomwMessage.FORMAT_TEXT;
|
||||||
// return $this->toString( self::FORMAT_TEXT );
|
return this.toString(XomwMessage.FORMAT_TEXT);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
// /**
|
||||||
// * Returns the message text as-is, only parameters are substituted.
|
// * Returns the message text as-is, only parameters are substituted.
|
||||||
// *
|
// *
|
||||||
@ -1155,8 +1161,8 @@ public class XomwMessage {
|
|||||||
// if ( isset( $param['raw'] ) ) {
|
// if ( isset( $param['raw'] ) ) {
|
||||||
// return [ 'after', $param['raw'] ];
|
// return [ 'after', $param['raw'] ];
|
||||||
// } elseif ( isset( $param['num'] ) ) {
|
// } elseif ( isset( $param['num'] ) ) {
|
||||||
// // Replace number params always in before step for now.
|
// // Replace number prmsVar always in before step for now.
|
||||||
// // No support for combined raw and num params
|
// // No support for combined raw and num prmsVar
|
||||||
// return [ 'before', $this->getLanguage()->formatNum( $param['num'] ) ];
|
// return [ 'before', $this->getLanguage()->formatNum( $param['num'] ) ];
|
||||||
// } elseif ( isset( $param['duration'] ) ) {
|
// } elseif ( isset( $param['duration'] ) ) {
|
||||||
// return [ 'before', $this->getLanguage()->formatDuration( $param['duration'] ) ];
|
// return [ 'before', $this->getLanguage()->formatDuration( $param['duration'] ) ];
|
||||||
@ -1304,16 +1310,16 @@ public class XomwMessage {
|
|||||||
// /**
|
// /**
|
||||||
// * Formats a list of parameters as a concatenated String.
|
// * Formats a list of parameters as a concatenated String.
|
||||||
// * @since 1.29
|
// * @since 1.29
|
||||||
// * @param array $params
|
// * @param array $prmsVar
|
||||||
// * @param String $listType
|
// * @param String $listType
|
||||||
// * @param String $format One of the FORMAT_* constants.
|
// * @param String $format One of the FORMAT_* constants.
|
||||||
// * @return array Array with the parameter type (either "before" or "after") and the value.
|
// * @return array Array with the parameter type (either "before" or "after") and the value.
|
||||||
// */
|
// */
|
||||||
// protected function formatListParam( array $params, $listType, $format ) {
|
// protected function formatListParam( array $prmsVar, $listType, $format ) {
|
||||||
// if ( !isset( self::$listTypeMap[$listType] ) ) {
|
// if ( !isset( self::$listTypeMap[$listType] ) ) {
|
||||||
// $warning = 'Invalid list type for message "' . $this->getKey() . '": '
|
// $warning = 'Invalid list type for message "' . $this->getKey() . '": '
|
||||||
// . htmlspecialchars( $listType )
|
// . htmlspecialchars( $listType )
|
||||||
// . ' (params are ' . htmlspecialchars( serialize( $params ) ) . ')';
|
// . ' (prmsVar are ' . htmlspecialchars( serialize( $prmsVar ) ) . ')';
|
||||||
// trigger_error( $warning, E_USER_WARNING );
|
// trigger_error( $warning, E_USER_WARNING );
|
||||||
// $e = new Exception;
|
// $e = new Exception;
|
||||||
// wfDebugLog( 'Bug58676', $warning . "\n" . $e->getTraceAsString() );
|
// wfDebugLog( 'Bug58676', $warning . "\n" . $e->getTraceAsString() );
|
||||||
@ -1322,7 +1328,7 @@ public class XomwMessage {
|
|||||||
// $func = self::$listTypeMap[$listType];
|
// $func = self::$listTypeMap[$listType];
|
||||||
//
|
//
|
||||||
// // Handle an empty list sensibly
|
// // Handle an empty list sensibly
|
||||||
// if ( !$params ) {
|
// if ( !$prmsVar ) {
|
||||||
// return [ 'before', $this->getLanguage()->$func( [] ) ];
|
// return [ 'before', $this->getLanguage()->$func( [] ) ];
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -1330,7 +1336,7 @@ public class XomwMessage {
|
|||||||
// $types = [];
|
// $types = [];
|
||||||
// $vars = [];
|
// $vars = [];
|
||||||
// $list = [];
|
// $list = [];
|
||||||
// foreach ( $params as $n => $p ) {
|
// foreach ( $prmsVar as $n => $p ) {
|
||||||
// list( $type, $value ) = $this->extractParam( $p, $format );
|
// list( $type, $value ) = $this->extractParam( $p, $format );
|
||||||
// $types[$type] = true;
|
// $types[$type] = true;
|
||||||
// $list[] = $value;
|
// $list[] = $value;
|
||||||
@ -1347,6 +1353,6 @@ public class XomwMessage {
|
|||||||
// // return the concatenated values as 'after'. We handle this by turning
|
// // return the concatenated values as 'after'. We handle this by turning
|
||||||
// // the list into a RawMessage and processing that as a parameter.
|
// // the list into a RawMessage and processing that as a parameter.
|
||||||
// $vars = $this->getLanguage()->$func( $vars );
|
// $vars = $this->getLanguage()->$func( $vars );
|
||||||
// return $this->extractParam( new RawMessage( $vars, $params ), $format );
|
// return $this->extractParam( new RawMessage( $vars, $prmsVar ), $format );
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import gplx.xowa.mediawiki.includes.parsers.*;
|
|||||||
*
|
*
|
||||||
* @ingroup Content
|
* @ingroup Content
|
||||||
*/
|
*/
|
||||||
abstract class XomwAbstractContent implements XomwContent {
|
public abstract class XomwAbstractContent implements XomwContent {
|
||||||
/**
|
/**
|
||||||
* Name of the content model this Content Object represents.
|
* Name of the content model this Content Object represents.
|
||||||
* Use with CONTENT_MODEL_XXX constants
|
* Use with CONTENT_MODEL_XXX constants
|
||||||
@ -117,160 +117,164 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
return this.getContentHandler().isSupportedFormat(format);
|
return this.getContentHandler().isSupportedFormat(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @since 1.21
|
* @since 1.21
|
||||||
// *
|
*
|
||||||
// * @param String $format The serialization format to check.
|
* @param String $format The serialization format to check.
|
||||||
// *
|
*
|
||||||
// * @throws MWException If the format is not supported by this content handler.
|
* @throws MWException If the format is not supported by this content handler.
|
||||||
// */
|
*/
|
||||||
// protected function checkFormat($format) {
|
public void checkFormat(String format) {
|
||||||
// if (!this.isSupportedFormat($format)) {
|
if (!this.isSupportedFormat(format)) {
|
||||||
// throw new MWException(
|
throw new XomwMWException(
|
||||||
// "Format $format is not supported for content model " .
|
"Format " + format + " is not supported for content model " +
|
||||||
// this.getModel()
|
this.getModel()
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @since 1.21
|
* @since 1.21
|
||||||
// *
|
*
|
||||||
// * @param String $format
|
* @param String $format
|
||||||
// *
|
*
|
||||||
// * @return String
|
* @return String
|
||||||
// *
|
*
|
||||||
// * @see Content::serialize
|
* @see Content::serialize
|
||||||
// */
|
*/
|
||||||
// public function serialize($format = null) {
|
public String serialize(String format) {
|
||||||
// return this.getContentHandler().serializeContent($this, $format);
|
// return this.getContentHandler().serializeContent(this, format);
|
||||||
// }
|
throw Err_.new_unimplemented();
|
||||||
//
|
}
|
||||||
// /**
|
|
||||||
// * @since 1.21
|
/**
|
||||||
// *
|
* @since 1.21
|
||||||
// * @return boolean
|
*
|
||||||
// *
|
* @return boolean
|
||||||
// * @see Content::isEmpty
|
*
|
||||||
// */
|
* @see Content::isEmpty
|
||||||
// public function isEmpty() {
|
*/
|
||||||
// return this.getSize() === 0;
|
public boolean isEmpty() {
|
||||||
// }
|
return this.getSize() == 0;
|
||||||
//
|
}
|
||||||
// /**
|
|
||||||
// * Subclasses may override this to implement (light weight) validation.
|
/**
|
||||||
// *
|
* Subclasses @Override may this to implement (light weight) validation.
|
||||||
// * @since 1.21
|
*
|
||||||
// *
|
* @since 1.21
|
||||||
// * @return boolean Always true.
|
*
|
||||||
// *
|
* @return boolean Always true.
|
||||||
// * @see Content::isValid
|
*
|
||||||
// */
|
* @see Content::isValid
|
||||||
// public function isValid() {
|
*/
|
||||||
// return true;
|
@gplx.Virtual public boolean isValid() {
|
||||||
// }
|
return true;
|
||||||
//
|
}
|
||||||
// /**
|
|
||||||
// * @since 1.21
|
/**
|
||||||
// *
|
* @since 1.21
|
||||||
// * @param Content $that
|
*
|
||||||
// *
|
* @param Content that
|
||||||
// * @return boolean
|
*
|
||||||
// *
|
* @return boolean
|
||||||
// * @see Content::equals
|
*
|
||||||
// */
|
* @see Content::equals
|
||||||
// public function equals(Content $that = null) {
|
*/
|
||||||
// if (is_null($that)) {
|
public boolean equals(XomwContent that) {
|
||||||
// return false;
|
if (that == null) {
|
||||||
// }
|
return false;
|
||||||
//
|
}
|
||||||
// if ($that === $this) {
|
|
||||||
// return true;
|
if (that == this) {
|
||||||
// }
|
return true;
|
||||||
//
|
}
|
||||||
// if ($that.getModel() !== this.getModel()) {
|
|
||||||
// return false;
|
if (that.getModel() != this.getModel()) {
|
||||||
// }
|
return false;
|
||||||
//
|
}
|
||||||
// return this.getNativeData() === $that.getNativeData();
|
|
||||||
// }
|
return this.getNativeData() == that.getNativeData();
|
||||||
//
|
}
|
||||||
// /**
|
|
||||||
// * Returns a list of DataUpdate objects for recording information about this
|
/**
|
||||||
// * Content in some secondary data store.
|
* Returns a list of DataUpdate objects for recording information about this
|
||||||
// *
|
* Content in some secondary data store.
|
||||||
// * This default implementation returns a LinksUpdate Object and calls the
|
*
|
||||||
// * SecondaryDataUpdates hook.
|
* This default implementation returns a LinksUpdate Object and calls the
|
||||||
// *
|
* SecondaryDataUpdates hook.
|
||||||
// * Subclasses may override this to determine the secondary data updates more
|
*
|
||||||
// * efficiently, preferably without the need to generate a parser output Object.
|
* Subclasses @Override may this to determine the secondary data updates more
|
||||||
// * They should however make sure to call SecondaryDataUpdates to give extensions
|
* efficiently, preferably without the need to generate a parser output Object.
|
||||||
// * a chance to inject additional updates.
|
* They should however make sure to call SecondaryDataUpdates to give extensions
|
||||||
// *
|
* a chance to inject additional updates.
|
||||||
// * @since 1.21
|
*
|
||||||
// *
|
* @since 1.21
|
||||||
// * @param Title $title
|
*
|
||||||
// * @param Content $old
|
* @param Title $title
|
||||||
// * @param boolean $recursive
|
* @param Content $old
|
||||||
// * @param ParserOutput $parserOutput
|
* @param boolean $recursive
|
||||||
// *
|
* @param ParserOutput parserOutput
|
||||||
// * @return DataUpdate[]
|
*
|
||||||
// *
|
* @return DataUpdate[]
|
||||||
// * @see Content::getSecondaryDataUpdates()
|
*
|
||||||
// */
|
* @see Content::getSecondaryDataUpdates()
|
||||||
// public function getSecondaryDataUpdates(Title $title, Content $old = null,
|
*/
|
||||||
// $recursive = true, ParserOutput $parserOutput = null
|
// recursive=true
|
||||||
|
// public XomwDataUpdate[] getSecondaryDataUpdates(Title title, Content old,
|
||||||
|
// boolean recursive, ParserOutput parserOutput
|
||||||
// ) {
|
// ) {
|
||||||
// if ($parserOutput === null) {
|
// if (parserOutput == null) {
|
||||||
// $parserOutput = this.getParserOutput($title, null, null, false);
|
// parserOutput = this.getParserOutput(title, null, null, false);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// $updates = [
|
// XomwDataUpdate[] updates = new XomwDataUpdate[] {
|
||||||
// new LinksUpdate($title, $parserOutput, $recursive)
|
// new LinksUpdate(title, parserOutput, recursive)
|
||||||
// ];
|
// };
|
||||||
//
|
//
|
||||||
// Hooks::run('SecondaryDataUpdates', [ $title, $old, $recursive, $parserOutput, &$updates ]);
|
// Hooks::run('SecondaryDataUpdates', [ $title, $old, $recursive, parserOutput, &$updates ]);
|
||||||
//
|
//
|
||||||
// return $updates;
|
// return updates;
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @since 1.21
|
* @since 1.21
|
||||||
// *
|
*
|
||||||
// * @return Title[]|null
|
* @return Title[]|null
|
||||||
// *
|
*
|
||||||
// * @see Content::getRedirectChain
|
* @see Content::getRedirectChain
|
||||||
// */
|
*/
|
||||||
// public function getRedirectChain() {
|
public XomwTitle[] getRedirectChain() {
|
||||||
// global $wgMaxRedirects;
|
// XomwTitle title = this.getRedirectTarget();
|
||||||
// $title = this.getRedirectTarget();
|
// if (title == null) {
|
||||||
// if (is_null($title)) {
|
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
// // recursive check to follow double redirects
|
// // recursive check to follow double redirects
|
||||||
// $recurse = $wgMaxRedirects;
|
// int recurse = XomwDefaultSettings.wgMaxRedirects;
|
||||||
// $titles = [ $title ];
|
//
|
||||||
// while (--$recurse > 0) {
|
// List_adp titles = List_adp_.New_by_many(title);
|
||||||
// if ($title.isRedirect()) {
|
// while (--recurse > 0) {
|
||||||
// $page = WikiPage::factory($title);
|
// XomwTitle newtitle = null;
|
||||||
|
// if (title.isRedirect()) {
|
||||||
|
// $page = WikiPage::factory(title);
|
||||||
// $newtitle = $page.getRedirectTarget();
|
// $newtitle = $page.getRedirectTarget();
|
||||||
// } else {
|
// } else {
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// // Redirects to some special pages are not permitted
|
// // Redirects to some special pages are not permitted
|
||||||
// if ($newtitle instanceof Title && $newtitle.isValidRedirectTarget()) {
|
// if (Type_adp_.Eq_typeSafe(newtitle, typeof(XomwTitle)) && newtitle.isValidRedirectTarget()) {
|
||||||
// // The new title passes the checks, so make that our current
|
// // The new title passes the checks, so make that our current
|
||||||
// // title so that further recursion can be checked
|
// // title so that further recursion can be checked
|
||||||
// $title = $newtitle;
|
// title = newtitle;
|
||||||
// $titles[] = $newtitle;
|
// titles.Add(newtitle);
|
||||||
// } else {
|
// } else {
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return $titles;
|
// return (XomwTitle[])titles.To_ary_and_clear(typeof(XomwTitle));
|
||||||
// }
|
throw Err_.new_unimplemented();
|
||||||
//
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Subclasses that implement redirects should override this.
|
// * Subclasses that implement redirects should override this.
|
||||||
// *
|
// *
|
||||||
@ -307,7 +311,7 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
// * @see Content::isRedirect
|
// * @see Content::isRedirect
|
||||||
// */
|
// */
|
||||||
// public function isRedirect() {
|
// public function isRedirect() {
|
||||||
// return this.getRedirectTarget() !== null;
|
// return this.getRedirectTarget() != null;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
@ -400,34 +404,34 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
// * @since 1.21
|
// * @since 1.21
|
||||||
// *
|
// *
|
||||||
// * @param WikiPage $page
|
// * @param WikiPage $page
|
||||||
// * @param ParserOutput $parserOutput
|
// * @param ParserOutput parserOutput
|
||||||
// *
|
// *
|
||||||
// * @return LinksDeletionUpdate[]
|
// * @return LinksDeletionUpdate[]
|
||||||
// *
|
// *
|
||||||
// * @see Content::getDeletionUpdates
|
// * @see Content::getDeletionUpdates
|
||||||
// */
|
// */
|
||||||
// public function getDeletionUpdates(WikiPage $page, ParserOutput $parserOutput = null) {
|
// public function getDeletionUpdates(WikiPage $page, ParserOutput parserOutput = null) {
|
||||||
// return [
|
// return [
|
||||||
// new LinksDeletionUpdate($page),
|
// new LinksDeletionUpdate($page),
|
||||||
// ];
|
// ];
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * This default implementation always returns false. Subclasses may override
|
* This default implementation always returns false. Subclasses @Override may
|
||||||
// * this to supply matching logic.
|
* this to supply matching logic.
|
||||||
// *
|
*
|
||||||
// * @since 1.21
|
* @since 1.21
|
||||||
// *
|
*
|
||||||
// * @param MagicWord $word
|
* @param MagicWord $word
|
||||||
// *
|
*
|
||||||
// * @return boolean Always false.
|
* @return boolean Always false.
|
||||||
// *
|
*
|
||||||
// * @see Content::matchMagicWord
|
* @see Content::matchMagicWord
|
||||||
// */
|
*/
|
||||||
// public function matchMagicWord(MagicWord $word) {
|
@gplx.Virtual public boolean matchMagicWord(XomwMagicWord word) {
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
// /**
|
||||||
// * This super implementation calls the hook ConvertContent to enable custom conversions.
|
// * This super implementation calls the hook ConvertContent to enable custom conversions.
|
||||||
// * Subclasses may override this to implement conversion for "their" content model.
|
// * Subclasses may override this to implement conversion for "their" content model.
|
||||||
@ -440,12 +444,12 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
// * @see Content::convert()
|
// * @see Content::convert()
|
||||||
// */
|
// */
|
||||||
// public function convert($toModel, $lossy = '') {
|
// public function convert($toModel, $lossy = '') {
|
||||||
// if (this.getModel() === $toModel) {
|
// if (this.getModel() == $toModel) {
|
||||||
// // nothing to do, shorten out.
|
// // nothing to do, shorten out.
|
||||||
// return $this;
|
// return $this;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// $lossy = ($lossy === 'lossy'); // String flag, convert to boolean for convenience
|
// $lossy = ($lossy == 'lossy'); // String flag, convert to boolean for convenience
|
||||||
// $result = false;
|
// $result = false;
|
||||||
//
|
//
|
||||||
// Hooks::run('ConvertContent', [ $this, $toModel, $lossy, &$result ]);
|
// Hooks::run('ConvertContent', [ $this, $toModel, $lossy, &$result ]);
|
||||||
@ -476,7 +480,7 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
// public function getParserOutput(Title $title, $revId = null,
|
// public function getParserOutput(Title $title, $revId = null,
|
||||||
// ParserOptions $options = null, $generateHtml = true
|
// ParserOptions $options = null, $generateHtml = true
|
||||||
// ) {
|
// ) {
|
||||||
// if ($options === null) {
|
// if ($options == null) {
|
||||||
// $options = this.getContentHandler().makeParserOptions('canonical');
|
// $options = this.getContentHandler().makeParserOptions('canonical');
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -534,14 +538,6 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
|
|
||||||
public abstract int getSize();
|
public abstract int getSize();
|
||||||
|
|
||||||
public abstract byte[] serialize(byte[] format);
|
|
||||||
|
|
||||||
public abstract boolean isEmpty();
|
|
||||||
|
|
||||||
public abstract boolean isValid();
|
|
||||||
|
|
||||||
public abstract boolean equals(XomwContent that);
|
|
||||||
|
|
||||||
public abstract XomwContent copy();
|
public abstract XomwContent copy();
|
||||||
|
|
||||||
public abstract boolean isCountable(boolean hasLinks);
|
public abstract boolean isCountable(boolean hasLinks);
|
||||||
@ -552,8 +548,6 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
public abstract Object getSecondaryDataUpdates(XomwTitle title, XomwContent old,
|
public abstract Object getSecondaryDataUpdates(XomwTitle title, XomwContent old,
|
||||||
boolean recursive, XomwParserOutput parserOutput);
|
boolean recursive, XomwParserOutput parserOutput);
|
||||||
|
|
||||||
public abstract XomwTitle[] getRedirectChain();
|
|
||||||
|
|
||||||
public abstract XomwTitle getRedirectTarget();
|
public abstract XomwTitle getRedirectTarget();
|
||||||
|
|
||||||
public abstract XomwTitle getUltimateRedirectTarget();
|
public abstract XomwTitle getUltimateRedirectTarget();
|
||||||
@ -577,7 +571,5 @@ abstract class XomwAbstractContent implements XomwContent {
|
|||||||
public abstract Object getDeletionUpdates(Object page,
|
public abstract Object getDeletionUpdates(Object page,
|
||||||
XomwParserOutput parserOutput);
|
XomwParserOutput parserOutput);
|
||||||
|
|
||||||
public abstract boolean matchMagicWord(XomwMagicWord word);
|
|
||||||
|
|
||||||
public abstract XomwContent convert(byte[] toModel, byte[] lossy);
|
public abstract XomwContent convert(byte[] toModel, byte[] lossy);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import gplx.xowa.mediawiki.includes.parsers.*;
|
|||||||
*
|
*
|
||||||
* @ingroup Content
|
* @ingroup Content
|
||||||
*/
|
*/
|
||||||
interface XomwContent {
|
public interface XomwContent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.21
|
* @since 1.21
|
||||||
@ -161,7 +161,7 @@ interface XomwContent {
|
|||||||
*
|
*
|
||||||
* @return String Serialized form of this Content Object.
|
* @return String Serialized form of this Content Object.
|
||||||
*/
|
*/
|
||||||
byte[] serialize(byte[] format);
|
String serialize(String format);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this Content Object represents empty content.
|
* Returns true if this Content Object represents empty content.
|
||||||
|
@ -33,7 +33,7 @@ package gplx.xowa.mediawiki.includes.content; import gplx.*; import gplx.xowa.*;
|
|||||||
*
|
*
|
||||||
* @ingroup Content
|
* @ingroup Content
|
||||||
*/
|
*/
|
||||||
abstract class XomwContentHandler {
|
public abstract class XomwContentHandler {
|
||||||
// /**
|
// /**
|
||||||
// * Convenience function for getting flat text from a Content Object. This
|
// * Convenience function for getting flat text from a Content Object. This
|
||||||
// * should only be used in the context of backwards compatibility with code
|
// * should only be used in the context of backwards compatibility with code
|
||||||
|
@ -1 +1 @@
|
|||||||
add hindi and tibetan wikis
|
v4.5.0.1703: app_update
|
||||||
|
Loading…
Reference in New Issue
Block a user