* @internal documentation reviewed 15 Mar 2010
*/
class Article implements Page {
- /**@{{
- * @private
- */
-
- /**
- * The context this Article is executed in
- * @var IContextSource $mContext
- */
+ /** @var IContextSource The context this Article is executed in */
protected $mContext;
- /**
- * The WikiPage object of this instance
- * @var WikiPage $mPage
- */
+ /** @var WikiPage The WikiPage object of this instance */
protected $mPage;
- /**
- * ParserOptions object for $wgUser articles
- * @var ParserOptions $mParserOptions
- */
+ /** @var ParserOptions ParserOptions object for $wgUser articles */
public $mParserOptions;
/**
- * Text of the revision we are working on
- * @var string $mContent
+ * @var string Text of the revision we are working on
+ * @todo BC cruft
*/
- var $mContent; // !< #BC cruft
+ public $mContent;
/**
- * Content of the revision we are working on
- * @var Content
+ * @var Content Content of the revision we are working on
* @since 1.21
*/
- var $mContentObject; // !<
+ protected $mContentObject;
- /**
- * Is the content ($mContent) already loaded?
- * @var bool $mContentLoaded
- */
- var $mContentLoaded = false; // !<
+ /** @var bool Is the content ($mContent) already loaded? */
+ protected $mContentLoaded = false;
- /**
- * The oldid of the article that is to be shown, 0 for the
- * current revision
- * @var int|null $mOldId
- */
- var $mOldId; // !<
+ /** @var int|null The oldid of the article that is to be shown, 0 for the current revision */
+ protected $mOldId;
- /**
- * Title from which we were redirected here
- * @var Title $mRedirectedFrom
- */
- var $mRedirectedFrom = null;
+ /** @var Title Title from which we were redirected here */
+ protected $mRedirectedFrom = null;
- /**
- * URL to redirect to or false if none
- * @var string|bool $mRedirectUrl
- */
- var $mRedirectUrl = false; // !<
+ /** @var string|bool URL to redirect to or false if none */
+ protected $mRedirectUrl = false;
- /**
- * Revision ID of revision we are working on
- * @var int $mRevIdFetched
- */
- var $mRevIdFetched = 0; // !<
+ /** @var int Revision ID of revision we are working on */
+ protected $mRevIdFetched = 0;
- /**
- * Revision we are working on
- * @var Revision $mRevision
- */
- var $mRevision = null;
-
- /**
- * ParserOutput object
- * @var ParserOutput $mParserOutput
- */
- var $mParserOutput;
+ /** @var Revision Revision we are working on */
+ protected $mRevision = null;
- /**@}}*/
+ /** @var ParserOutput */
+ public $mParserOutput;
/**
* Constructor and clear the article
*/
class CategoryViewer extends ContextSource {
- var $limit, $from, $until,
- $articles, $articles_start_char,
- $children, $children_start_char,
- $showGallery, $imgsNoGalley,
- $imgsNoGallery_start_char,
- $imgsNoGallery;
+ /** @var int */
+ public $limit;
- /**
- * @var array
- */
- var $nextPage;
+ /** @var array */
+ protected $from;
- /**
- * @var array
- */
- var $flip;
+ /** @var array */
+ protected $until;
- /**
- * @var Title
- */
- var $title;
+ /** @var string[] */
+ public $articles;
- /**
- * @var Collation
- */
- var $collation;
+ /** @var array */
+ public $articles_start_char;
- /**
- * @var ImageGallery
- */
- var $gallery;
+ /** @var array */
+ protected $children;
- /**
- * Category object for this page
- * @var Category
- */
+ /** @var array */
+ protected $children_start_char;
+
+ /** @var bool */
+ protected $showGallery;
+
+ /** @var array */
+ protected $imgsNoGallery_start_char;
+
+ /** @var array */
+ protected $imgsNoGallery;
+
+ /** @var array */
+ protected $nextPage;
+
+ /** @var array */
+ protected $flip;
+
+ /** @var Title */
+ protected $title;
+
+ /** @var Collation */
+ protected $collation;
+
+ /** @var ImageGallery */
+ protected $gallery;
+
+ /** @var Category Category object for this page. */
private $cat;
- /**
- * The original query array, to be used in generating paging links.
- * @var array
- */
+ /** @var array The original query array, to be used in generating paging links. */
private $query;
/**
- * Constructor
- *
* @since 1.19 $context is a second, required parameter
* @param Title $title
* @param IContextSource $context
$this->mVersion = $version;
}
+ // @codingStandardsIgnoreStart
+ // PSR2.Methods.MethodDeclaration.Underscore
+ // PSR2.Classes.PropertyDeclaration.ScopeMissing
function _newObject() {
+
/* Put the caller offset for wfDeprecated as 6, as
* that gives the function that uses this object, since:
* 1 = this function ( _newObject )
wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 );
return $this->mRealValue;
}
+ // @codingStandardsIgnoreEnd
}
* The cookie will be removed instantly if the JavaScript runs.
*
* Otherwise, though, we don't want the cookies to accumulate.
- * RFC 2109 ( https://www.ietf.org/rfc/rfc2109.txt ) specifies a possible limit of only 20 cookies per domain.
- * This still applies at least to some versions of IE without full updates:
+ * RFC 2109 ( https://www.ietf.org/rfc/rfc2109.txt ) specifies a possible
+ * limit of only 20 cookies per domain. This still applies at least to some
+ * versions of IE without full updates:
* https://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx
*
* A value of 20 minutes should be enough to take into account slow loads and minor
*/
const POST_EDIT_COOKIE_DURATION = 1200;
- /**
- * @var Article
- */
- var $mArticle;
+ /** @var Article */
+ public $mArticle;
- /**
- * @var Title
- */
- var $mTitle;
+ /** @var Title */
+ public $mTitle;
+
+ /** @var null|Title */
private $mContextTitle = null;
- var $action = 'submit';
- var $isConflict = false;
- var $isCssJsSubpage = false;
- var $isCssSubpage = false;
- var $isJsSubpage = false;
- var $isWrongCaseCssJsPage = false;
- var $isNew = false; // new page or new section
- var $deletedSinceEdit;
- var $formtype;
- var $firsttime;
- var $lastDelete;
- var $mTokenOk = false;
- var $mTokenOkExceptSuffix = false;
- var $mTriedSave = false;
- var $incompleteForm = false;
- var $tooBig = false;
- var $kblength = false;
- var $missingComment = false;
- var $missingSummary = false;
- var $allowBlankSummary = false;
- var $autoSumm = '';
- var $hookError = '';
- #var $mPreviewTemplates;
-
- /**
- * @var ParserOutput
- */
- var $mParserOutput;
-
- /**
- * Has a summary been preset using GET parameter &summary= ?
- * @var bool
- */
- var $hasPresetSummary = false;
-
- var $mBaseRevision = false;
- var $mShowSummaryField = true;
+
+ /** @var string */
+ protected $action = 'submit';
+
+ /** @var bool */
+ public $isConflict = false;
+
+ /** @var bool */
+ public $isCssJsSubpage = false;
+
+ /** @var bool */
+ public $isCssSubpage = false;
+
+ /** @var bool */
+ public $isJsSubpage = false;
+
+ /** @var bool */
+ protected $isWrongCaseCssJsPage = false;
+
+ /** @var bool New page or new section */
+ protected $isNew = false;
+
+ /** @var bool */
+ protected $deletedSinceEdit;
+
+ /** @var string */
+ public $formtype;
+
+ /** @var bool */
+ public $firsttime;
+
+ /** @var bool|stdClass */
+ protected $lastDelete;
+
+ /** @var bool */
+ protected $mTokenOk = false;
+
+ /** @var bool */
+ protected $mTokenOkExceptSuffix = false;
+
+ /** @var bool */
+ protected $mTriedSave = false;
+
+ /** @var bool */
+ protected $incompleteForm = false;
+
+ /** @var bool */
+ protected $tooBig = false;
+
+ /** @var bool */
+ protected $kblength = false;
+
+ /** @var bool */
+ protected $missingComment = false;
+
+ /** @var bool */
+ protected $missingSummary = false;
+
+ /** @var bool */
+ protected $allowBlankSummary = false;
+
+ /** @var string */
+ protected $autoSumm = '';
+
+ /** @var string */
+ public $hookError = '';
+
+ /** @var ParserOutput */
+ protected $mParserOutput;
+
+ /** @var bool Has a summary been preset using GET parameter &summary= ? */
+ protected $hasPresetSummary = false;
+
+ /** @var bool */
+ protected $mBaseRevision = false;
+
+ /** @var bool */
+ public $mShowSummaryField = true;
# Form values
- var $save = false, $preview = false, $diff = false;
- var $minoredit = false, $watchthis = false, $recreate = false;
- var $textbox1 = '', $textbox2 = '', $summary = '', $nosummary = false;
- var $edittime = '', $section = '', $sectiontitle = '', $starttime = '';
- var $oldid = 0, $editintro = '', $scrolltop = null, $bot = true;
- var $contentModel = null, $contentFormat = null;
+
+ /** @var bool */
+ public $save = false;
+
+ /** @var bool */
+ public $preview = false;
+
+ /** @var bool */
+ protected $diff = false;
+
+ /** @var bool */
+ public $minoredit = false;
+
+ /** @var bool */
+ protected $watchthis = false;
+
+ /** @var bool */
+ protected $recreate = false;
+
+ /** @var string */
+ public $textbox1 = '';
+
+ /** @var string */
+ public $textbox2 = '';
+
+ /** @var string */
+ public $summary = '';
+
+ /** @var bool */
+ protected $nosummary = false;
+
+ /** @var string */
+ public $edittime = '';
+
+ /** @var string */
+ public $section = '';
+
+ /** @var string */
+ public $sectiontitle = '';
+
+ /** @var string */
+ protected $starttime = '';
+
+ /** @var int */
+ public $oldid = 0;
+
+ /** @var string */
+ protected $editintro = '';
+
+ /** @var null */
+ public $scrolltop = null;
+
+ /** @var bool */
+ public $bot = true;
+
+ /** @var null|string */
+ public $contentModel = null;
+
+ /** @var null|string */
+ public $contentFormat = null;
# Placeholders for text injection by hooks (must be HTML)
# extensions should take care to _append_ to the present value
- public $editFormPageTop = ''; // Before even the preview
+
+ /** @var string Before even the preview */
+ public $editFormPageTop = '';
public $editFormTextTop = '';
public $editFormTextBeforeContent = '';
public $editFormTextAfterWarn = '';
public $suppressIntro = false;
- /**
- * Set to true to allow editing of non-text content types.
- *
- * @var bool
- */
+ /** @var bool Set to true to allow editing of non-text content types. */
public $allowNonTextContent = false;
+ /** @var bool */
+ protected $edit;
+
+ /** @var bool */
+ public $live;
+
/**
* @param Article $article
*/
$this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
$this->isCssSubpage = $this->mTitle->isCssSubpage();
$this->isJsSubpage = $this->mTitle->isJsSubpage();
+ // @todo FIXME: Silly assignment.
$this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage();
# Show applicable editing introductions
wfRunHooks( 'EditPage::showReadOnlyForm:initial', array( $this, &$wgOut ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
- $wgOut->setPageTitle( wfMessage( 'viewsource-title', $this->getContextTitle()->getPrefixedText() ) );
+ $wgOut->setPageTitle( wfMessage(
+ 'viewsource-title',
+ $this->getContextTitle()->getPrefixedText()
+ ) );
$wgOut->addBacklinkSubtitle( $this->getContextTitle() );
$wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) );
$wgOut->addHTML( "<hr />\n" );
} elseif ( $this->section == 'new' ) {
// Nothing *to* preview for new sections
return false;
- } elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
+ } elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() )
+ && $wgUser->getOption( 'previewonfirst' )
+ ) {
// Standard preference behavior
return true;
} elseif ( !$this->mTitle->exists()
) {
$this->allowBlankSummary = true;
} else {
- $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' ) || !$wgUser->getOption( 'forceeditsummary' );
+ $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' )
+ || !$wgUser->getOption( 'forceeditsummary' );
}
$this->autoSumm = $request->getText( 'wpAutoSummary' );
$this->save = false;
$this->diff = false;
$this->minoredit = false;
- $this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overridden by request parameters
+ // Watch may be overridden by request parameters
+ $this->watchthis = $request->getBool( 'watchthis', false );
$this->recreate = false;
// When creating a new section, we can preload a section title by passing it as the
$this->bot = $request->getBool( 'bot', true );
$this->nosummary = $request->getBool( 'nosummary' );
- $this->contentModel = $request->getText( 'model', $this->contentModel ); #may be overridden by revision
- $this->contentFormat = $request->getText( 'format', $this->contentFormat ); #may be overridden by revision
+ // May be overridden by revision.
+ $this->contentModel = $request->getText( 'model', $this->contentModel );
+ // May be overridden by revision.
+ $this->contentFormat = $request->getText( 'format', $this->contentFormat );
- if ( !ContentHandler::getForModelID( $this->contentModel )->isSupportedFormat( $this->contentFormat ) ) {
+ if ( !ContentHandler::getForModelID( $this->contentModel )
+ ->isSupportedFormat( $this->contentFormat )
+ ) {
throw new ErrorPageError(
'editpage-notsupportedcontentformat-title',
'editpage-notsupportedcontentformat-text',
array( $this->contentFormat, ContentHandler::getLocalizedName( $this->contentModel ) )
);
}
- #TODO: check if the desired model is allowed in this namespace, and if a transition from the page's current model to the new model is allowed
+
+ /**
+ * @todo Check if the desired model is allowed in this namespace, and if
+ * a transition from the page's current model to the new model is
+ * allowed.
+ */
$this->live = $request->getCheck( 'live' );
$this->editintro = $request->getText( 'editintro',
* @param array|bool $resultDetails
*
* @throws ErrorPageError
- * return bool false, if output is done, true if rest of the form should be displayed
+ * @return bool false, if output is done, true if rest of the form should be displayed
*/
private function handleStatus( Status $status, $resultDetails ) {
global $wgUser, $wgOut;
- // FIXME: once the interface for internalAttemptSave() is made nicer, this should use the message in $status
- if ( $status->value == self::AS_SUCCESS_UPDATE || $status->value == self::AS_SUCCESS_NEW_ARTICLE ) {
+ /**
+ * @todo FIXME: once the interface for internalAttemptSave() is made
+ * nicer, this should use the message in $status
+ */
+ if ( $status->value == self::AS_SUCCESS_UPDATE
+ || $status->value == self::AS_SUCCESS_NEW_ARTICLE
+ ) {
$this->didSave = true;
if ( !$resultDetails['nullEdit'] ) {
$this->setPostEditCookie( $status->value );
$sectionanchor = $resultDetails['sectionanchor'];
// Give extensions a chance to modify URL query on update
- wfRunHooks( 'ArticleUpdateBeforeRedirect', array( $this->mArticle, &$sectionanchor, &$extraQuery ) );
+ wfRunHooks(
+ 'ArticleUpdateBeforeRedirect',
+ array( $this->mArticle, &$sectionanchor, &$extraQuery )
+ );
if ( $resultDetails['redirect'] ) {
if ( $extraQuery == '' ) {
/**
* Attempt submission (no UI)
*
- * @param array $result Array to add statuses to, currently with the possible keys:
- * spam - string - Spam string from content if any spam is detected by matchSpamRegex
- * sectionanchor - string - Section anchor for a section save
- * nullEdit - boolean - Set if doEditContent is OK. True if null edit, false otherwise.
- * redirect - boolean - Set if doEditContent is OK. True if resulting revision is a redirect
+ * @param array $result Array to add statuses to, currently with the
+ * possible keys:
+ * - spam (string): Spam string from content if any spam is detected by
+ * matchSpamRegex.
+ * - sectionanchor (string): Section anchor for a section save.
+ * - nullEdit (boolean): Set if doEditContent is OK. True if null edit,
+ * false otherwise.
+ * - redirect (bool): Set if doEditContent is OK. True if resulting
+ * revision is a redirect.
* @param bool $bot True if edit is being made under the bot right.
*
- * @return Status Status object, possibly with a message, but always with one of the AS_* constants in $status->value,
+ * @return Status Status object, possibly with a message, but always with
+ * one of the AS_* constants in $status->value,
*
- * FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are
- * also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g.
- * AS_CONTENT_TOO_BIG and AS_BLOCKED_PAGE_FOR_USER. All that stuff needs to be cleaned up some time.
+ * @todo FIXME: This interface is TERRIBLE, but hard to get rid of due to
+ * various error display idiosyncrasies. There are also lots of cases
+ * where error metadata is set in the object and retrieved later instead
+ * of being returned, e.g. AS_CONTENT_TOO_BIG and
+ * AS_BLOCKED_PAGE_FOR_USER. All that stuff needs to be cleaned up some
+ * time.
*/
function internalAttemptSave( &$result, $bot = false ) {
global $wgUser, $wgRequest, $wgParser, $wgMaxArticleSize;
# Construct Content object
$textbox_content = $this->toEditContent( $this->textbox1 );
} catch ( MWContentSerializationException $ex ) {
- $status->fatal( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
+ $status->fatal(
+ 'content-failed-to-parse',
+ $this->contentModel,
+ $this->contentFormat,
+ $ex->getMessage()
+ );
$status->value = self::AS_PARSE_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
wfProfileOut( __METHOD__ );
wfProfileOut( __METHOD__ );
return $status;
}
- if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) {
+ if ( !wfRunHooks(
+ 'EditFilter',
+ array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) )
+ ) {
# Error messages etc. could be handled within the hook...
$status->fatal( 'hookaborted' );
$status->value = self::AS_HOOK_ERROR;
$content = $content->addSectionHeader( $this->sectiontitle );
// Jump to the new section
- $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->sectiontitle );
+ $result['sectionanchor'] =
+ $wgParser->guessLegacySectionNameFromWikiText( $this->sectiontitle );
// If no edit summary was specified, create one automatically from the section
// title and have it link to the new section. Otherwise, respect the summary as
// Probably a duplicate submission of a new comment.
// This can happen when squid resends a request after
// a timeout but the first one actually went through.
- wfDebug( __METHOD__ . ": duplicate new section submission; trigger edit conflict!\n" );
+ wfDebug( __METHOD__
+ . ": duplicate new section submission; trigger edit conflict!\n" );
} else {
// New comment; suppress conflict.
$this->isConflict = false;
wfDebug( __METHOD__ . ": conflict suppressed; new section\n" );
}
- } elseif ( $this->section == '' && Revision::userWasLastToEdit( DB_MASTER, $this->mTitle->getArticleID(),
- $wgUser->getId(), $this->edittime ) ) {
+ } elseif ( $this->section == ''
+ && Revision::userWasLastToEdit(
+ DB_MASTER, $this->mTitle->getArticleID(),
+ $wgUser->getId(), $this->edittime
+ )
+ ) {
# Suppress edit conflict with self, except for section edits where merging is required.
wfDebug( __METHOD__ . ": Suppressing edit conflict, same user.\n" );
$this->isConflict = false;
$content = null;
if ( $this->isConflict ) {
- wfDebug( __METHOD__ . ": conflict! getting section '{$this->section}' for time '{$this->edittime}'"
- . " (article time '{$timestamp}')\n" );
-
- $content = $this->mArticle->replaceSectionContent( $this->section, $textbox_content, $sectionTitle, $this->edittime );
+ wfDebug( __METHOD__
+ . ": conflict! getting section '{$this->section}' for time '{$this->edittime}'"
+ . " (article time '{$timestamp}')\n" );
+
+ $content = $this->mArticle->replaceSectionContent(
+ $this->section,
+ $textbox_content,
+ $sectionTitle,
+ $this->edittime
+ );
} else {
wfDebug( __METHOD__ . ": getting section '{$this->section}'\n" );
- $content = $this->mArticle->replaceSectionContent( $this->section, $textbox_content, $sectionTitle );
+ $content = $this->mArticle->replaceSectionContent(
+ $this->section,
+ $textbox_content,
+ $sectionTitle
+ );
}
if ( is_null( $content ) ) {
->rawParams( $cleanSummary )->inContentLanguage()->text();
}
} elseif ( $this->section != '' ) {
- # Try to get a section anchor from the section source, redirect to edited section if header found
- # XXX: might be better to integrate this into Article::replaceSection
- # for duplicate heading checking and maybe parsing
+ # Try to get a section anchor from the section source, redirect
+ # to edited section if header found.
+ # XXX: Might be better to integrate this into Article::replaceSection
+ # for duplicate heading checking and maybe parsing.
$hasmatch = preg_match( "/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1, $matches );
- # we can't deal with anchors, includes, html etc in the header for now,
- # headline would need to be parsed to improve this
+ # We can't deal with anchors, includes, html etc in the header for now,
+ # headline would need to be parsed to improve this.
if ( $hasmatch && strlen( $matches[2] ) > 0 ) {
$sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $matches[2] );
}
} elseif ( $contextTitle->exists() && $this->section != '' ) {
$msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
} else {
- $msg = $contextTitle->exists() || ( $contextTitle->getNamespace() == NS_MEDIAWIKI && $contextTitle->getDefaultMessageText() !== false ) ?
- 'editing' : 'creating';
+ $msg = $contextTitle->exists()
+ || ( $contextTitle->getNamespace() == NS_MEDIAWIKI
+ && $contextTitle->getDefaultMessageText() !== false
+ )
+ ? 'editing'
+ : 'creating';
}
+
# Use the title defined by DISPLAYTITLE magic word when present
$displayTitle = isset( $this->mParserOutput ) ? $this->mParserOutput->getDisplayTitle() : false;
if ( $displayTitle === false ) {
*
* If $content is null or false or a string, $content is returned unchanged.
*
- * If the given Content object is not of a type that can be edited using the text base EditPage,
- * an exception will be raised. Set $this->allowNonTextContent to true to allow editing of non-textual
+ * If the given Content object is not of a type that can be edited using
+ * the text base EditPage, an exception will be raised. Set
+ * $this->allowNonTextContent to true to allow editing of non-textual
* content.
*
* @param Content|null|bool|string $content
* @return string The editable text form of the content.
*
- * @throws MWException if $content is not an instance of TextContent and $this->allowNonTextContent is not true.
+ * @throws MWException if $content is not an instance of TextContent and
+ * $this->allowNonTextContent is not true.
*/
protected function toEditText( $content ) {
if ( $content === null || $content === false ) {
/**
* Turns the given text into a Content object by unserializing it.
*
- * If the resulting Content object is not of a type that can be edited using the text base EditPage,
- * an exception will be raised. Set $this->allowNonTextContent to true to allow editing of non-textual
+ * If the resulting Content object is not of a type that can be edited using
+ * the text base EditPage, an exception will be raised. Set
+ * $this->allowNonTextContent to true to allow editing of non-textual
* content.
*
* @param string|null|bool $text Text to unserialize
- * @return Content The content object created from $text. If $text was false or null, false resp. null will be
- * returned instead.
+ * @return Content The content object created from $text. If $text was false
+ * or null, false resp. null will be returned instead.
*
- * @throws MWException if unserializing the text results in a Content object that is not an instance of TextContent
- * and $this->allowNonTextContent is not true.
+ * @throws MWException if unserializing the text results in a Content
+ * object that is not an instance of TextContent and
+ * $this->allowNonTextContent is not true.
*/
protected function toEditContent( $text ) {
if ( $text === false || $text === null ) {
// @todo add EditForm plugin interface and use it here!
// search for textarea1 and textares2, and allow EditForm to override all uses.
- $wgOut->addHTML( Html::openElement( 'form', array( 'id' => self::EDITFORM_ID, 'name' => self::EDITFORM_ID,
- 'method' => 'post', 'action' => $this->getActionURL( $this->getContextTitle() ),
- 'enctype' => 'multipart/form-data' ) ) );
+ $wgOut->addHTML( Html::openElement(
+ 'form',
+ array(
+ 'id' => self::EDITFORM_ID,
+ 'name' => self::EDITFORM_ID,
+ 'method' => 'post',
+ 'action' => $this->getActionURL( $this->getContextTitle() ),
+ 'enctype' => 'multipart/form-data'
+ )
+ ) );
if ( is_callable( $formCallback ) ) {
call_user_func_array( $formCallback, array( &$wgOut ) );
// Add an empty field to trip up spambots
$wgOut->addHTML(
Xml::openElement( 'div', array( 'id' => 'antispam-container', 'style' => 'display: none;' ) )
- . Html::rawElement( 'label', array( 'for' => 'wpAntiSpam' ), wfMessage( 'simpleantispam-label' )->parse() )
- . Xml::element( 'input', array( 'type' => 'text', 'name' => 'wpAntispam', 'id' => 'wpAntispam', 'value' => '' ) )
+ . Html::rawElement(
+ 'label',
+ array( 'for' => 'wpAntiSpam' ),
+ wfMessage( 'simpleantispam-label' )->parse()
+ )
+ . Xml::element(
+ 'input',
+ array(
+ 'type' => 'text',
+ 'name' => 'wpAntispam',
+ 'id' => 'wpAntispam',
+ 'value' => ''
+ )
+ )
. Xml::closeElement( 'div' )
);
$this->showConflict();
} catch ( MWContentSerializationException $ex ) {
// this can't really happen, but be nice if it does.
- $msg = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
+ $msg = wfMessage(
+ 'content-failed-to-parse',
+ $this->contentModel,
+ $this->contentFormat,
+ $ex->getMessage()
+ );
$wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
}
}
}
}
+ /**
+ * @return bool
+ */
protected function showHeader() {
global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang;
// Let sysop know that this will make private content public if saved
if ( !$revision->userCan( Revision::DELETED_TEXT, $wgUser ) ) {
- $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", 'rev-deleted-text-permission' );
+ $wgOut->wrapWikiMsg(
+ "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
+ 'rev-deleted-text-permission'
+ );
} elseif ( $revision->isDeleted( Revision::DELETED_TEXT ) ) {
- $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", 'rev-deleted-text-view' );
+ $wgOut->wrapWikiMsg(
+ "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
+ 'rev-deleted-text-view'
+ );
}
if ( !$revision->isCurrent() ) {
}
if ( wfReadOnly() ) {
- $wgOut->wrapWikiMsg( "<div id=\"mw-read-only-warning\">\n$1\n</div>", array( 'readonlywarning', wfReadOnlyReason() ) );
+ $wgOut->wrapWikiMsg(
+ "<div id=\"mw-read-only-warning\">\n$1\n</div>",
+ array( 'readonlywarning', wfReadOnlyReason() )
+ );
} elseif ( $wgUser->isAnon() ) {
if ( $this->formtype != 'preview' ) {
$wgOut->wrapWikiMsg( "<div id=\"mw-anon-edit-warning\">\n$1</div>", 'anoneditwarning' );
if ( $this->isCssJsSubpage ) {
# Check the skin exists
if ( $this->isWrongCaseCssJsPage ) {
- $wgOut->wrapWikiMsg( "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
+ $wgOut->wrapWikiMsg(
+ "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>",
+ array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() )
+ );
}
if ( $this->formtype !== 'preview' ) {
if ( $this->isCssSubpage ) {
- $wgOut->wrapWikiMsg( "<div id='mw-usercssyoucanpreview'>\n$1\n</div>", array( 'usercssyoucanpreview' ) );
+ $wgOut->wrapWikiMsg(
+ "<div id='mw-usercssyoucanpreview'>\n$1\n</div>",
+ array( 'usercssyoucanpreview' )
+ );
}
if ( $this->isJsSubpage ) {
- $wgOut->wrapWikiMsg( "<div id='mw-userjsyoucanpreview'>\n$1\n</div>", array( 'userjsyoucanpreview' ) );
+ $wgOut->wrapWikiMsg(
+ "<div id='mw-userjsyoucanpreview'>\n$1\n</div>",
+ array( 'userjsyoucanpreview' )
+ );
}
}
}
if ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
$wgOut->wrapWikiMsg( "<div class='error' id='mw-edit-longpageerror'>\n$1\n</div>",
- array( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) ) );
+ array(
+ 'longpageerror',
+ $wgLang->formatNum( $this->kblength ),
+ $wgLang->formatNum( $wgMaxArticleSize )
+ )
+ );
} else {
if ( !wfMessage( 'longpage-hint' )->isDisabled() ) {
$wgOut->wrapWikiMsg( "<div id='mw-edit-longpage-hint'>\n$1\n</div>",
- array( 'longpage-hint', $wgLang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) )
+ array(
+ 'longpage-hint',
+ $wgLang->formatSize( strlen( $this->textbox1 ) ),
+ strlen( $this->textbox1 )
+ )
);
}
}
# Add header copyright warning
$this->showHeaderCopyrightWarning();
+
+ return true;
}
/**
*
* @return array An array in the format array( $label, $input )
*/
- function getSummaryInput( $summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null ) {
+ function getSummaryInput( $summary = "", $labelText = null,
+ $inputAttrs = null, $spanLabelAttrs = null
+ ) {
// Note: the maxlength is overridden in JS to 255 and to make it use UTF-8 bytes, not characters.
$inputAttrs = ( is_array( $inputAttrs ) ? $inputAttrs : array() ) + array(
'id' => 'wpSummary',
$label = null;
if ( $labelText ) {
- $label = Xml::tags( 'label', $inputAttrs['id'] ? array( 'for' => $inputAttrs['id'] ) : null, $labelText );
+ $label = Xml::tags(
+ 'label',
+ $inputAttrs['id'] ? array( 'for' => $inputAttrs['id'] ) : null,
+ $labelText
+ );
$label = Xml::tags( 'span', $spanLabelAttrs, $label );
}
}
$summary = $wgContLang->recodeForEdit( $summary );
$labelText = wfMessage( $isSubjectPreview ? 'subject' : 'summary' )->parse();
- list( $label, $input ) = $this->getSummaryInput( $summary, $labelText, array( 'class' => $summaryClass ), array() );
+ list( $label, $input ) = $this->getSummaryInput(
+ $summary,
+ $labelText,
+ array( 'class' => $summaryClass ),
+ array()
+ );
$wgOut->addHTML( "{$label} {$input}" );
}
$message = $isSubjectPreview ? 'subject-preview' : 'summary-preview';
- $summary = wfMessage( $message )->parse() . Linker::commentBlock( $summary, $this->mTitle, $isSubjectPreview );
+ $summary = wfMessage( $message )->parse()
+ . Linker::commentBlock( $summary, $this->mTitle, $isSubjectPreview );
return Xml::tags( 'div', array( 'class' => 'mw-summary-preview' ), $summary );
}
}
}
- $this->showTextbox( $textoverride !== null ? $textoverride : $this->textbox1, 'wpTextbox1', $attribs );
+ $this->showTextbox(
+ $textoverride !== null ? $textoverride : $this->textbox1,
+ 'wpTextbox1',
+ $attribs
+ );
}
protected function showTextbox2() {
'id' => $name,
'cols' => $wgUser->getIntOption( 'cols' ),
'rows' => $wgUser->getIntOption( 'rows' ),
- 'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work
+ // Avoid PHP notices when appending preferences
+ // (appending allows customAttribs['style'] to still work).
+ 'style' => ''
);
$pageLang = $this->mTitle->getPageLanguage();
try {
$this->showDiff();
} catch ( MWContentSerializationException $ex ) {
- $msg = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
+ $msg = wfMessage(
+ 'content-failed-to-parse',
+ $this->contentModel,
+ $this->contentFormat,
+ $ex->getMessage()
+ );
$wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
}
}
array( 'class' => 'mw-editButtons-pipe-separator' ),
wfMessage( 'pipe-separator' )->text() );
}
- $edithelpurl = Skin::makeInternalOrExternalUrl( wfMessage( 'edithelppage' )->inContentLanguage()->text() );
+
+ $message = wfMessage( 'edithelppage' )->inContentLanguage()->text();
+ $edithelpurl = Skin::makeInternalOrExternalUrl( $message );
$edithelp = '<a target="helpwindow" href="' . $edithelpurl . '">' .
wfMessage( 'edithelp' )->escaped() . '</a> ' .
wfMessage( 'newwindow' )->parse();
+
$wgOut->addHTML( " <span class='cancelLink'>{$cancel}</span>\n" );
$wgOut->addHTML( " <span class='editHelp'>{$edithelp}</span>\n" );
$wgOut->addHTML( "</div><!-- editButtons -->\n" );
+
wfRunHooks( 'EditPage::showStandardInputs:options', array( $this, $wgOut, &$tabindex ) );
+
$wgOut->addHTML( "</div><!-- editOptions -->\n" );
}
return $this->deletedSinceEdit;
}
+ /**
+ * @return bool|stdClass
+ */
protected function getLastDelete() {
$dbr = wfGetDB( DB_SLAVE );
$data = $dbr->selectRow(
$data->log_comment = wfMessage( 'rev-deleted-comment' )->escaped();
}
}
+
return $data;
}
$content = $this->toEditContent( $this->textbox1 );
$previewHTML = '';
- if ( !wfRunHooks( 'AlternateEditPreview', array( $this, &$content, &$previewHTML, &$this->mParserOutput ) ) ) {
+ if ( !wfRunHooks(
+ 'AlternateEditPreview',
+ array( $this, &$content, &$previewHTML, &$this->mParserOutput ) )
+ ) {
wfProfileOut( __METHOD__ );
return $previewHTML;
}
# But it's now deprecated, so never mind
$content = $content->preSaveTransform( $this->mTitle, $wgUser, $parserOptions );
- $parserOutput = $content->getParserOutput( $this->getArticle()->getTitle(), null, $parserOptions );
+ $parserOutput = $content->getParserOutput(
+ $this->getArticle()->getTitle(),
+ null,
+ $parserOptions
+ );
$previewHTML = $parserOutput->getText();
$this->mParserOutput = $parserOutput;
$note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() );
}
} catch ( MWContentSerializationException $ex ) {
- $m = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
+ $m = wfMessage(
+ 'content-failed-to-parse',
+ $this->contentModel,
+ $this->contentFormat,
+ $ex->getMessage()
+ );
$note .= "\n\n" . $m->parse();
$previewHTML = '';
}
if ( $this->isConflict ) {
- $conflict = '<h2 id="mw-previewconflict">' . wfMessage( 'previewconflict' )->escaped() . "</h2>\n";
+ $conflict = '<h2 id="mw-previewconflict">'
+ . wfMessage( 'previewconflict' )->escaped() . "</h2>\n";
} else {
$conflict = '<hr />';
}
public function getEditButtons( &$tabindex ) {
$buttons = array();
+ // @todo FIXME: Hardcoded square brackets.
$temp = array(
'id' => 'wpSave',
'name' => 'wpSave',
'tabindex' => ++$tabindex,
'value' => wfMessage( 'savearticle' )->text(),
'accesskey' => wfMessage( 'accesskey-save' )->text(),
- 'title' => wfMessage( 'tooltip-save' )->text() . ' [' . wfMessage( 'accesskey-save' )->text() . ']',
+ 'title' => wfMessage( 'tooltip-save' )->text()
+ . ' [' . wfMessage( 'accesskey-save' )->text() . ']',
);
$buttons['save'] = Xml::element( 'input', $temp, '' );
++$tabindex; // use the same for preview and live preview
+ // @todo FIXME: Hardcoded square brackets.
$temp = array(
'id' => 'wpPreview',
'name' => 'wpPreview',
'tabindex' => $tabindex,
'value' => wfMessage( 'showpreview' )->text(),
'accesskey' => wfMessage( 'accesskey-preview' )->text(),
- 'title' => wfMessage( 'tooltip-preview' )->text() . ' [' . wfMessage( 'accesskey-preview' )->text() . ']',
+ 'title' => wfMessage( 'tooltip-preview' )->text()
+ . ' [' . wfMessage( 'accesskey-preview' )->text() . ']',
);
$buttons['preview'] = Xml::element( 'input', $temp, '' );
$buttons['live'] = '';
+ // @todo FIXME: Hardcoded square brackets.
$temp = array(
'id' => 'wpDiff',
'name' => 'wpDiff',
'tabindex' => ++$tabindex,
'value' => wfMessage( 'showdiff' )->text(),
'accesskey' => wfMessage( 'accesskey-diff' )->text(),
- 'title' => wfMessage( 'tooltip-diff' )->text() . ' [' . wfMessage( 'accesskey-diff' )->text() . ']',
+ 'title' => wfMessage( 'tooltip-diff' )->text()
+ . ' [' . wfMessage( 'accesskey-diff' )->text() . ']',
);
$buttons['diff'] = Xml::element( 'input', $temp, '' );
$bytesleft = 0;
$result = "";
$working = 0;
- for ( $i = 0; $i < strlen( $invalue ); $i++ ) {
+ $valueLength = strlen( $invalue );
+ for ( $i = 0; $i < $valueLength; $i++ ) {
$bytevalue = ord( $invalue[$i] );
if ( $bytevalue <= 0x7F ) { // 0xxx xxxx
$result .= chr( $bytevalue );
* @ingroup SpecialPage Dump
*/
class WikiExporter {
- var $list_authors = false; # Return distinct author list (when not returning full history)
- var $author_list = "";
+ /** @var bool Return distinct author list (when not returning full history) */
+ public $list_authors = false;
- var $dumpUploads = false;
- var $dumpUploadFileContents = false;
+ /** @var bool */
+ public $dumpUploads = false;
+
+ /** @var bool */
+ public $dumpUploadFileContents = false;
+
+ /** @var string */
+ protected $author_list = "";
const FULL = 1;
const CURRENT = 2;
const TEXT = 0;
const STUB = 1;
- var $buffer;
+ /** @var int */
+ protected $buffer;
- var $text;
+ /** @var int */
+ protected $text;
- /**
- * @var DumpOutput
- */
- var $sink;
+ /** @var DumpOutput */
+ protected $sink;
/**
* Returns the export schema version.
}
}
}
-
}
/**
* @ingroup Dump
*/
class DumpGZipOutput extends DumpPipeOutput {
-
/**
* @param string $file
*/
* @ingroup Dump
*/
class DumpBZip2Output extends DumpPipeOutput {
-
/**
* @param string $file
*/
* @ingroup Dump
*/
class Dump7ZipOutput extends DumpPipeOutput {
-
/**
* @param string $file
*/
* @ingroup Dump
*/
class DumpFilter {
-
/**
* @var DumpOutput
* FIXME will need to be made protected whenever legacy code
* @ingroup Dump
*/
class DumpNotalkFilter extends DumpFilter {
-
/**
* @param object $page
* @return bool
* @ingroup Dump
*/
class DumpNamespaceFilter extends DumpFilter {
- var $invert = false;
- var $namespaces = array();
+ /** @var bool */
+ protected $invert = false;
+
+ /** @var array */
+ protected $namespaces = array();
/**
* @param DumpOutput $sink
* @ingroup Dump
*/
class DumpLatestFilter extends DumpFilter {
- var $page, $pageString, $rev, $revString;
+ protected $page;
+
+ protected $pageString;
+
+ protected $rev;
+
+ protected $revString;
/**
* @param object $page
}
return $filenames;
}
-
}
/**
* @param string $string
* @return string
+ * @todo FIXME: Only used in OAI extension. Move over there.
*/
function xmlsafe( $string ) {
wfProfileIn( __FUNCTION__ );
* @ingroup Feed
*/
class FeedItem {
- /**
- * @var Title
- */
- var $title;
+ /** @var Title */
+ protected $title;
+
+ protected $description;
+
+ protected $url;
+
+ protected $date;
- var $description;
- var $url;
- var $date;
- var $author;
- var $uniqueId;
- var $comments;
- var $rssIsPermalink = false;
+ protected $author;
+
+ protected $uniqueId;
+
+ protected $comments;
+
+ public $rssIsPermalink = false;
/**
* Constructor
* Return an internet media type to be sent in the headers.
*
* @return string
- * @private
*/
- function contentType() {
+ private function contentType() {
global $wgRequest;
+
$ctype = $wgRequest->getVal( 'ctype', 'application/xml' );
- $allowedctypes = array( 'application/xml', 'text/xml', 'application/rss+xml', 'application/atom+xml' );
+ $allowedctypes = array(
+ 'application/xml',
+ 'text/xml',
+ 'application/rss+xml',
+ 'application/atom+xml'
+ );
+
return ( in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml' );
}
/**
* Output the initial XML headers with a stylesheet for legibility
* if someone finds it in a browser.
- * @private
*/
- function outXmlHeader() {
+ protected function outXmlHeader() {
global $wgStylePath, $wgStyleVersion;
$this->httpHeaders();
echo '<?xml version="1.0"?>' . "\n";
echo '<?xml-stylesheet type="text/css" href="' .
- htmlspecialchars( wfExpandUrl( "$wgStylePath/common/feed.css?$wgStyleVersion", PROTO_CURRENT ) ) .
+ htmlspecialchars( wfExpandUrl(
+ "$wgStylePath/common/feed.css?$wgStyleVersion",
+ PROTO_CURRENT
+ ) ) .
'"?' . ">\n";
}
}
* @param FeedItem $item Item to be output
*/
function outItem( $item ) {
+ // @codingStandardsIgnoreStart Ignore long lines and formatting issues.
?>
<item>
<title><?php print $item->getTitle(); ?></title>
<?php if ( $item->getComments() ) { ?><comments><?php print wfExpandUrl( $item->getComments(), PROTO_CURRENT ); ?></comments><?php }?>
</item>
<?php
+ // @codingStandardsIgnoreEnd
}
/**
global $wgVersion;
$this->outXmlHeader();
+ // @codingStandardsIgnoreStart Ignore long lines and formatting issues.
?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
<id><?php print $this->getFeedId() ?></id>
<title><?php print $this->getTitle() ?></title>
<generator>MediaWiki <?php print $wgVersion ?></generator>
<?php
+ // @codingStandardsIgnoreEnd
}
/**
* have to change the id? Maybe? Maybe not.
*
* @return string
- * @private
*/
- function getFeedId() {
+ private function getFeedId() {
return $this->getSelfUrl();
}
/**
* Atom 1.0 requests a self-reference to the feed.
* @return string
- * @private
*/
- function getSelfUrl() {
+ private function getSelfUrl() {
global $wgRequest;
return htmlspecialchars( $wgRequest->getFullRequestURL() );
}
*/
function outItem( $item ) {
global $wgMimeType;
+ // @codingStandardsIgnoreStart Ignore long lines and formatting issues.
?>
<entry>
<id><?php print $item->getUniqueId(); ?></id>
*/
function outFooter() {?>
</feed><?php
+ // @codingStandardsIgnoreEnd
}
}
* two-part external storage URLs. Used for represent efficient concatenated
* storage, and migration-related pointer objects.
*/
-interface HistoryBlob
-{
+interface HistoryBlob {
/**
* Adds an item of text, returns a stub object which points to the item.
* You must call setLocation() on the stub object before storing it to the
* Concatenated gzip (CGZ) storage
* Improves compression ratio by concatenating like objects before gzipping
*/
-class ConcatenatedGzipHistoryBlob implements HistoryBlob
-{
+class ConcatenatedGzipHistoryBlob implements HistoryBlob {
public $mVersion = 0, $mCompressed = false, $mItems = array(), $mDefaultHash = '';
public $mSize = 0;
public $mMaxSize = 10000000;
*/
public function __construct() {
if ( !function_exists( 'gzdeflate' ) ) {
- throw new MWException( "Need zlib support to read or write this kind of history object (ConcatenatedGzipHistoryBlob)\n" );
+ throw new MWException( "Need zlib support to read or write this "
+ . "kind of history object (ConcatenatedGzipHistoryBlob)\n" );
}
}
*/
class HistoryBlobStub {
/**
- * One-step cache variable to hold base blobs; operations that
- * pull multiple revisions may often pull multiple times from
- * the same blob. By keeping the last-used one open, we avoid
- * redundant unserialization and decompression overhead.
+ * @var array One-step cache variable to hold base blobs; operations that
+ * pull multiple revisions may often pull multiple times from the same
+ * blob. By keeping the last-used one open, we avoid redundant
+ * unserialization and decompression overhead.
*/
protected static $blobCache = array();
- var $mOldId, $mHash, $mRef;
+ /** @var int */
+ protected $mOldId;
+
+ /** @var string */
+ protected $mHash;
+
+ /** @var */
+ protected $mRef;
/**
* @param string $hash The content hash of the text
$obj = self::$blobCache[$this->mOldId];
} else {
$dbr = wfGetDB( DB_SLAVE );
- $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
+ $row = $dbr->selectRow(
+ 'text',
+ array( 'old_flags', 'old_text' ),
+ array( 'old_id' => $this->mOldId )
+ );
+
if ( !$row ) {
return false;
}
+
$flags = explode( ',', $row->old_flags );
if ( in_array( 'external', $flags ) ) {
$url = $row->old_text;
$row->old_text = ExternalStore::fetchFromUrl( $url );
}
+
if ( !in_array( 'object', $flags ) ) {
return false;
}
$obj->uncompress();
self::$blobCache = array( $this->mOldId => $obj );
}
+
return $obj->getItem( $this->mHash );
}
* on conversion if $wgLegacySchemaConversion is set to true.
*/
class HistoryBlobCurStub {
- var $mCurId;
+ /** @var int */
+ private $mCurId;
/**
* @param int $curid The cur_id pointed to
* Requires xdiff 1.5+ and zlib
*/
class DiffHistoryBlob implements HistoryBlob {
- /** Uncompressed item cache */
- var $mItems = array();
+ /** @var array Uncompressed item cache */
+ protected $mItems = array();
- /** Total uncompressed size */
- var $mSize = 0;
+ /** @var int Total uncompressed size */
+ protected $mSize = 0;
/**
- * Array of diffs. If a diff D from A to B is notated D = B - A, and Z is
- * an empty string:
+ * @var array Array of diffs. If a diff D from A to B is notated D = B - A,
+ * and Z is an empty string:
*
* { item[map[i]] - item[map[i-1]] where i > 0
* diff[i] = {
* { item[map[i]] - Z where i = 0
*/
- var $mDiffs;
+ protected $mDiffs;
- /** The diff map, see above */
- var $mDiffMap;
+ /** @var array The diff map, see above */
+ protected $mDiffMap;
- /**
- * The key for getText()
+ /** @var int The key for getText()
*/
- var $mDefaultKey;
+ protected $mDefaultKey;
- /**
- * Compressed storage
- */
- var $mCompressed;
+ /** @var string Compressed storage */
+ protected $mCompressed;
- /**
- * True if the object is locked against further writes
- */
- var $mFrozen = false;
+ /** @var bool True if the object is locked against further writes */
+ protected $mFrozen = false;
/**
- * The maximum uncompressed size before the object becomes sad
+ * @var int The maximum uncompressed size before the object becomes sad
* Should be less than max_allowed_packet
*/
- var $mMaxSize = 10000000;
+ public $mMaxSize = 10000000;
- /**
- * The maximum number of text items before the object becomes sad
- */
- var $mMaxCount = 100;
+ /** @var int The maximum number of text items before the object becomes sad */
+ public $mMaxCount = 100;
/** Constants from xdiff.h */
const XDL_BDOP_INS = 1;
);
$smallFactor = 0.5;
- for ( $i = 0; $i < count( $this->mItems ); $i++ ) {
+ $mItemsCount = count( $this->mItems );
+ for ( $i = 0; $i < $mItemsCount; $i++ ) {
$text = $this->mItems[$i];
if ( $i == 0 ) {
$seqName = 'main';
$this->mDiffs[] = $this->diff( $tail, $head );
}
$this->mDiffMap[] = $seq['map'][0];
- for ( $i = 1; $i < count( $seq['diffs'] ); $i++ ) {
+ $diffsCount = count( $seq['diffs'] );
+ for ( $i = 1; $i < $diffsCount; $i++ ) {
$this->mDiffs[] = $seq['diffs'][$i];
$this->mDiffMap[] = $seq['map'][$i];
}
return;
}
$tail = '';
- for ( $diffKey = 0; $diffKey < count( $this->mDiffs ); $diffKey++ ) {
+ $mDiffsCount = count( $this->mDiffs );
+ for ( $diffKey = 0; $diffKey < $mDiffsCount; $diffKey++ ) {
$textKey = $this->mDiffMap[$diffKey];
$text = $this->patch( $tail, $this->mDiffs[$diffKey] );
$this->mItems[$textKey] = $text;
$this->mTargetRootPage = null;
} elseif ( $rootpage !== '' ) {
$rootpage = rtrim( $rootpage, '/' ); //avoid double slashes
- $title = Title::newFromText( $rootpage, !is_null( $this->mTargetNamespace ) ? $this->mTargetNamespace : NS_MAIN );
+ $title = Title::newFromText( $rootpage, !is_null( $this->mTargetNamespace )
+ ? $this->mTargetNamespace
+ : NS_MAIN
+ );
+
if ( !$title || $title->isExternal() ) {
$status->fatal( 'import-rootpage-invalid' );
} else {
/**
* Default per-revision callback, performs the import.
- * @param WikiRevision $rev
+ * @param WikiRevision $revision
* @return bool
*/
- public function importLogItem( $rev ) {
+ public function importLogItem( $revision ) {
$dbw = wfGetDB( DB_MASTER );
- return $dbw->deadlockLoop( array( $rev, 'importLogItem' ) );
+ return $dbw->deadlockLoop( array( $revision, 'importLogItem' ) );
}
/**
* @param int $revCount
* @param int $sRevCount
* @param array $pageInfo
- * @return
+ * @return bool
*/
public function finishImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) {
$args = func_get_args();
/** This is a horrible hack used to keep source compatibility */
class UploadSourceAdapter {
- static $sourceRegistrations = array();
+ /** @var array */
+ private static $sourceRegistrations = array();
+ /** @var string */
private $mSource;
+
+ /** @var string */
private $mBuffer;
+
+ /** @var int */
private $mPosition;
/**
* @ingroup SpecialPage
*/
class WikiRevision {
- var $importer = null;
-
- /**
- * @var Title
- */
- var $title = null;
- var $id = 0;
- var $timestamp = "20010115000000";
- var $user = 0;
- var $user_text = "";
- var $model = null;
- var $format = null;
- var $text = "";
- var $content = null;
- var $comment = "";
- var $minor = false;
- var $type = "";
- var $action = "";
- var $params = "";
- var $fileSrc = '';
- var $sha1base36 = false;
- var $isTemp = false;
- var $archiveName = '';
- var $fileIsTemp;
+ /** @todo Unused? */
+ private $importer = null;
+
+ /** @var Title */
+ public $title = null;
+
+ /** @var int */
+ private $id = 0;
+
+ /** @var string */
+ public $timestamp = "20010115000000";
+
+ /**
+ * @var int
+ * @todo Can't find any uses. Public, because that's suspicious. Get clarity. */
+ public $user = 0;
+
+ /** @var string */
+ public $user_text = "";
+
+ /** @var string */
+ protected $model = null;
+
+ /** @var string */
+ protected $format = null;
+
+ /** @var string */
+ public $text = "";
+
+ /** @var int */
+ protected $size;
+
+ /** @var Content */
+ protected $content = null;
+
+ /** @var string */
+ public $comment = "";
+
+ /** @var bool */
+ protected $minor = false;
+
+ /** @var string */
+ protected $type = "";
+
+ /** @var string */
+ protected $action = "";
+
+ /** @var string */
+ protected $params = "";
+
+ /** @var string */
+ protected $fileSrc = '';
+
+ /** @var bool|string */
+ protected $sha1base36 = false;
+
+ /**
+ * @var bool
+ * @todo Unused?
+ */
+ private $isTemp = false;
+
+ /** @var string */
+ protected $archiveName = '';
+
+ protected $filename;
+
+ /** @var mixed */
+ protected $src;
+
+ /** @todo Unused? */
+ private $fileIsTemp;
+
+ /** @var bool */
private $mNoUpdates = false;
/**
if ( is_object( $title ) ) {
$this->title = $title;
} elseif ( is_null( $title ) ) {
- throw new MWException( "WikiRevision given a null title in import. You may need to adjust \$wgLegalTitleChars." );
+ throw new MWException( "WikiRevision given a null title in import. "
+ . "You may need to adjust \$wgLegalTitleChars." );
} else {
throw new MWException( "WikiRevision given non-object title in import." );
}
'page' => $pageId,
'content_model' => $this->getModel(),
'content_format' => $this->getFormat(),
- 'text' => $this->getContent()->serialize( $this->getFormat() ), //XXX: just set 'content' => $this->getContent()?
+ //XXX: just set 'content' => $this->getContent()?
+ 'text' => $this->getContent()->serialize( $this->getFormat() ),
'comment' => $this->getComment(),
'user' => $userId,
'user_text' => $userText,
if ( $changed !== false && !$this->mNoUpdates ) {
wfDebug( __METHOD__ . ": running updates\n" );
- $page->doEditUpdates( $revision, $userObj, array( 'created' => $created, 'oldcountable' => $oldcountable ) );
+ $page->doEditUpdates(
+ $revision,
+ $userObj,
+ array( 'created' => $created, 'oldcountable' => $oldcountable )
+ );
}
return true;
);
// @todo FIXME: This could fail slightly for multiple matches :P
if ( $prior ) {
- wfDebug( __METHOD__ . ": skipping existing item for Log:{$this->type}/{$this->action}, timestamp " .
- $this->timestamp . "\n" );
+ wfDebug( __METHOD__
+ . ": skipping existing item for Log:{$this->type}/{$this->action}, timestamp "
+ . $this->timestamp . "\n" );
return;
}
$log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
}
if ( !empty( $upload['error'] ) ) {
switch ( $upload['error'] ) {
- case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
+ case 1:
+ # The uploaded file exceeds the upload_max_filesize directive in php.ini.
return Status::newFatal( 'importuploaderrorsize' );
- case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
+ case 2:
+ # The uploaded file exceeds the MAX_FILE_SIZE directive that
+ # was specified in the HTML form.
return Status::newFatal( 'importuploaderrorsize' );
- case 3: # The uploaded file was only partially uploaded
+ case 3:
+ # The uploaded file was only partially uploaded
return Status::newFatal( 'importuploaderrorpartial' );
- case 6: #Missing a temporary folder.
+ case 6:
+ # Missing a temporary folder.
return Status::newFatal( 'importuploaderrortemp' );
# case else: # Currently impossible
}
* @param int $pageLinkDepth
* @return Status
*/
- public static function newFromInterwiki( $interwiki, $page, $history = false, $templates = false, $pageLinkDepth = 0 ) {
+ public static function newFromInterwiki( $interwiki, $page, $history = false,
+ $templates = false, $pageLinkDepth = 0
+ ) {
if ( $page == '' ) {
return Status::newFatal( 'import-noarticle' );
}
* @ingroup Skins
*/
class Linker {
-
/**
* Flags for userToolLinks()
*/
* @param string $class The contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
* @return string
- * @deprecated since 1.18 Just pass the external class directly to something using Html::expandAttributes
+ * @deprecated since 1.18 Just pass the external class directly to something
+ * using Html::expandAttributes.
*/
static function getExternalLinkAttributes( $class = 'external' ) {
wfDeprecated( __METHOD__, '1.18' );
if ( $target->getPrefixedText() === '' && $target->hasFragment() ) {
return htmlspecialchars( $target->getFragment() );
}
+
return htmlspecialchars( $target->getPrefixedText() );
}
/**
- * Make appropriate markup for a link to the current article. This is currently rendered
- * as the bold link text. The calling sequence is the same as the other make*LinkObj static functions,
- * despite $query not being used.
+ * Make appropriate markup for a link to the current article. This is
+ * currently rendered as the bold link text. The calling sequence is the
+ * same as the other make*LinkObj static functions, despite $query not
+ * being used.
*
* @param Title $nt
* @param string $html [optional]
* @param string $trail [optional]
* @param string $prefix [optional]
*
- *
* @return string
*/
public static function makeSelfLinkObj( $nt, $html = '', $query = '', $trail = '', $prefix = '' ) {
$img = '';
$success = wfRunHooks( 'LinkerMakeExternalImage', array( &$url, &$alt, &$img ) );
if ( !$success ) {
- wfDebug( "Hook LinkerMakeExternalImage changed the output of external image with url {$url} and alt text {$alt} to {$img}\n", true );
+ wfDebug( "Hook LinkerMakeExternalImage changed the output of external image "
+ . "with url {$url} and alt text {$alt} to {$img}\n", true );
return $img;
}
return Html::element( 'img',
* @since 1.20
* @return string HTML for an image, with links, wrappers, etc.
*/
- public static function makeImageLink( /*Parser*/ $parser, Title $title, $file, $frameParams = array(),
- $handlerParams = array(), $time = false, $query = "", $widthOption = null
+ public static function makeImageLink( /*Parser*/ $parser, Title $title,
+ $file, $frameParams = array(), $handlerParams = array(), $time = false,
+ $query = "", $widthOption = null
) {
$res = null;
$dummy = new DummyLinker;
$hp['width'] = $file->getWidth( $page );
}
- if ( isset( $fp['thumbnail'] ) || isset( $fp['manualthumb'] ) || isset( $fp['framed'] ) || isset( $fp['frameless'] ) || !$hp['width'] ) {
+ if ( isset( $fp['thumbnail'] )
+ || isset( $fp['manualthumb'] )
+ || isset( $fp['framed'] )
+ || isset( $fp['frameless'] )
+ || !$hp['width']
+ ) {
global $wgThumbLimits, $wgThumbUpright;
+
if ( $widthOption === null || !isset( $wgThumbLimits[$widthOption] ) ) {
$widthOption = User::getDefaultOption( 'thumbsize' );
}
if ( isset( $fp['upright'] ) && $fp['upright'] == 0 ) {
$fp['upright'] = $wgThumbUpright;
}
- // For caching health: If width scaled down due to upright parameter, round to full __0 pixel to avoid the creation of a lot of odd thumbs
+
+ // For caching health: If width scaled down due to upright
+ // parameter, round to full __0 pixel to avoid the creation of a
+ // lot of odd thumbs.
$prefWidth = isset( $fp['upright'] ) ?
round( $wgThumbLimits[$widthOption] * $fp['upright'], -1 ) :
$wgThumbLimits[$widthOption];
if ( $file && isset( $fp['frameless'] ) ) {
$srcWidth = $file->getWidth( $page );
- # For "frameless" option: do not present an image bigger than the source (for bitmap-style images)
- # This is the same behavior as the "thumb" option does it already.
+ # For "frameless" option: do not present an image bigger than the
+ # source (for bitmap-style images). This is the same behavior as the
+ # "thumb" option does it already.
if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
$hp['width'] = $srcWidth;
}
$fp['link-url'] = $url;
}
- $s = "<div class=\"thumb t{$fp['align']}\"><div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
+ $s = "<div class=\"thumb t{$fp['align']}\">"
+ . "<div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
+
if ( !$exists ) {
$s .= self::makeBrokenImageLinkObj( $title, $fp['title'], '', '', '', $time == true );
$zoomIcon = '';
$params = array(
'alt' => $fp['alt'],
'title' => $fp['title'],
- 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ? $fp['class'] . ' ' : '' ) . 'thumbimage'
+ 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== ''
+ ? $fp['class'] . ' '
+ : '' ) . 'thumbimage'
);
$params = self::getImageLinkMTOParams( $fp, $query ) + $params;
$s .= $thumb->toHtml( $params );
'class' => 'internal',
'title' => wfMessage( 'thumbnail-more' )->text() ),
Html::element( 'img', array(
- 'src' => $wgStylePath . '/common/images/magnify-clip' . ( $wgContLang->isRTL() ? '-rtl' : '' ) . '.png',
+ 'src' => $wgStylePath . '/common/images/magnify-clip'
+ . ( $wgContLang->isRTL() ? '-rtl' : '' ) . '.png',
'width' => 15,
'height' => 11,
'alt' => "" ) ) ) );
* @param bool $time A file of a certain timestamp was requested
* @return string
*/
- public static function makeBrokenImageLinkObj( $title, $label = '', $query = '', $unused1 = '', $unused2 = '', $time = false ) {
+ public static function makeBrokenImageLinkObj( $title, $label = '',
+ $query = '', $unused1 = '', $unused2 = '', $time = false
+ ) {
global $wgEnableUploads, $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
if ( ! $title instanceof Title ) {
return "<!-- ERROR -->" . htmlspecialchars( $label );
$encLabel = htmlspecialchars( $label );
$currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
- if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads ) && !$currentExists ) {
+ if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
+ && !$currentExists
+ ) {
$redir = RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title );
if ( $redir ) {
if ( !wfRunHooks( 'LinkerMakeMediaLinkFile',
array( $title, $file, &$html, &$attribs, &$ret ) ) ) {
- wfDebug( "Hook LinkerMakeMediaLinkFile changed the output of link with url {$url} and text {$html} to {$ret}\n", true );
+ wfDebug( "Hook LinkerMakeMediaLinkFile changed the output of link "
+ . "with url {$url} and text {$html} to {$ret}\n", true );
return $ret;
}
* @param Title|null $title Title object used for title specific link attributes
* @return string
*/
- public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array(), $title = null ) {
+ public static function makeExternalLink( $url, $text, $escape = true,
+ $linktype = '', $attribs = array(), $title = null
+ ) {
global $wgTitle;
$class = "external";
if ( $linktype ) {
$success = wfRunHooks( 'LinkerMakeExternalLink',
array( &$url, &$text, &$link, &$attribs, $linktype ) );
if ( !$success ) {
- wfDebug( "Hook LinkerMakeExternalLink changed the output of link with url {$url} and text {$text} to {$link}\n", true );
+ wfDebug( "Hook LinkerMakeExternalLink changed the output of link "
+ . "with url {$url} and text {$text} to {$link}\n", true );
return $link;
}
$attribs['href'] = $url;
* @param string $userText User name or IP address
* @param bool $redContribsWhenNoEdits Should the contributions link be
* red if the user has no edits?
- * @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL)
+ * @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
+ * and Linker::TOOL_LINKS_EMAIL).
* @param int $edits User edit count (optional, for performance)
* @return string HTML fragment
*/
return $comment;
}
- /**
- * @var Title
- */
- static $autocommentTitle;
- static $autocommentLocal;
+ /** @var Title */
+ private static $autocommentTitle;
+
+ /** @var bool Whether section links should refer to local page */
+ private static $autocommentLocal;
/**
* Converts autogenerated comments in edit summaries into section links.
$auto .= wfMessage( 'colon-separator' )->inContentLanguage()->escaped();
}
$auto = '<span class="autocomment">' . $auto . '</span>';
- $comment = $pre . $link . $wgLang->getDirMark() . '<span dir="auto">' . $auto . $post . '</span>';
+ $comment = $pre . $link . $wgLang->getDirMark()
+ . '<span dir="auto">' . $auto . $post . '</span>';
}
return $comment;
}
- /**
- * @var Title
- */
- static $commentContextTitle;
- static $commentLocal;
+ /** @var Title */
+ private static $commentContextTitle;
+
+ /** @var bool Whether section links should refer to local page */
+ private static $commentLocal;
/**
* Formats wiki links and media links in text; all other wiki formatting
}
if ( $thelink ) {
// If the link is still valid, go ahead and replace it in!
- $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 );
+ $comment = preg_replace(
+ $linkRegexp,
+ StringUtils::escapeRegexReplacement( $thelink ),
+ $comment,
+ 1
+ );
}
return $comment;
*
* @return string HTML headline
*/
- public static function makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor = false ) {
+ public static function makeHeadline( $level, $attribs, $anchor, $html,
+ $link, $legacyAnchor = false
+ ) {
$ret = "<h$level$attribs"
. "<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
. $link
* @param array $options
* @return string
*/
- public static function generateRollback( $rev, IContextSource $context = null, $options = array( 'verify' ) ) {
+ public static function generateRollback( $rev, IContextSource $context = null,
+ $options = array( 'verify' )
+ ) {
if ( $context === null ) {
$context = RequestContext::getMain();
}
+
$editCount = false;
if ( in_array( 'verify', $options ) ) {
$editCount = self::getRollbackEditCount( $rev, true );
$moreRevs = false;
foreach ( $res as $row ) {
if ( $rev->getRawUserText() != $row->rev_user_text ) {
- if ( $verify && ( $row->rev_deleted & Revision::DELETED_TEXT || $row->rev_deleted & Revision::DELETED_USER ) ) {
- // If the user or the text of the revision we might rollback to is deleted in some way we can't rollback
- // Similar to the sanity checks in WikiPage::commitRollback
+ if ( $verify &&
+ ( $row->rev_deleted & Revision::DELETED_TEXT
+ || $row->rev_deleted & Revision::DELETED_USER
+ ) ) {
+ // If the user or the text of the revision we might rollback
+ // to is deleted in some way we can't rollback. Similar to
+ // the sanity checks in WikiPage::commitRollback.
return false;
}
$moreRevs = true;
* @param int $editCount Number of edits that would be reverted
* @return string HTML fragment
*/
- public static function buildRollbackLink( $rev, IContextSource $context = null, $editCount = false ) {
+ public static function buildRollbackLink( $rev, IContextSource $context = null,
+ $editCount = false
+ ) {
global $wgShowRollbackEditCount, $wgMiserMode;
// To config which pages are effected by miser mode
$query = array(
'action' => 'rollback',
'from' => $rev->getUserText(),
- 'token' => $context->getUser()->getEditToken( array( $title->getPrefixedText(), $rev->getUserText() ) ),
+ 'token' => $context->getUser()->getEditToken( array(
+ $title->getPrefixedText(),
+ $rev->getUserText()
+ ) ),
);
if ( $context->getRequest()->getBool( 'bot' ) ) {
$query['bot'] = '1';
}
}
- if ( !$disableRollbackEditCount && is_int( $wgShowRollbackEditCount ) && $wgShowRollbackEditCount > 0 ) {
+ if ( !$disableRollbackEditCount
+ && is_int( $wgShowRollbackEditCount )
+ && $wgShowRollbackEditCount > 0
+ ) {
if ( !is_numeric( $editCount ) ) {
$editCount = self::getRollbackEditCount( $rev, false );
}
if ( $editCount > $wgShowRollbackEditCount ) {
- $editCount_output = $context->msg( 'rollbacklinkcount-morethan' )->numParams( $wgShowRollbackEditCount )->parse();
+ $editCount_output = $context->msg( 'rollbacklinkcount-morethan' )
+ ->numParams( $wgShowRollbackEditCount )->parse();
} else {
$editCount_output = $context->msg( 'rollbacklinkcount' )->numParams( $editCount )->parse();
}
* @param Title|Message|string|null $more An escaped link for "More..." of the templates
* @return string HTML output
*/
- public static function formatTemplates( $templates, $preview = false, $section = false, $more = null ) {
+ public static function formatTemplates( $templates, $preview = false,
+ $section = false, $more = null
+ ) {
global $wgLang;
wfProfileIn( __METHOD__ );
$outText .= "</div><ul>\n";
foreach ( $hiddencats as $titleObj ) {
- $outText .= '<li>' . self::link( $titleObj, null, array(), array(), 'known' ) . "</li>\n"; # If it's hidden, it must exist - no need to check with a LinkBatch
+ # If it's hidden, it must exist - no need to check with a LinkBatch
+ $outText .= '<li>'
+ . self::link( $titleObj, null, array(), array(), 'known' )
+ . "</li>\n";
}
$outText .= '</ul>';
}
return $tooltip;
}
- static $accesskeycache;
+ private static $accesskeycache;
/**
* Given the id of an interface element, constructs the appropriate
$html = wfMessage( $msgKey )->escaped();
$tag = $restricted ? 'strong' : 'span';
$link = self::link( $sp, $html, array(), $query, array( 'known', 'noclasses' ) );
- return Xml::tags( $tag, array( 'class' => 'mw-revdelundel-link' ), wfMessage( 'parentheses' )->rawParams( $link )->escaped() );
+ return Xml::tags(
+ $tag,
+ array( 'class' => 'mw-revdelundel-link' ),
+ wfMessage( 'parentheses' )->rawParams( $link )->escaped()
+ );
}
/**
/**
* Constructor
*
- * @param object $row Either a database row or an array
+ * @param object|array $row Either a database row or an array
* @throws MWException
* @access private
*/
$html = $this->parse( $text, true );
return "<div class=\"mw-help-field-container\">\n" .
- "<span class=\"mw-help-field-hint\" title=\"" . wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
+ "<span class=\"mw-help-field-hint\" title=\"" .
+ wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
wfMessage( 'config-help' )->escaped() . "</span>\n" .
"<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
"</div>\n";
if ( !$result ) {
// Try running the XML through UtfNormal to get rid of invalid characters
$xml = UtfNormal::cleanUp( $xml );
- // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep
+ // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2
+ // don't barf when the XML is >256 levels deep
$result = $dom->loadXML( $xml, 1 << 19 );
}
wfProfileOut( __METHOD__ . '-loadXML' );