dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve comments on fields and fix opening_text - needs no highlights."
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiParse.php
diff --git
a/includes/api/ApiParse.php
b/includes/api/ApiParse.php
index
5754c23
..
3e66cad
100644
(file)
--- a/
includes/api/ApiParse.php
+++ b/
includes/api/ApiParse.php
@@
-72,7
+72,7
@@
class ApiParse extends ApiBase {
$this->section = $params['section'];
if ( !preg_match( '/^((T-)?\d+|new)$/', $this->section ) ) {
$this->dieUsage(
$this->section = $params['section'];
if ( !preg_match( '/^((T-)?\d+|new)$/', $this->section ) ) {
$this->dieUsage(
- "The section parameter must be a valid section id or 'new'", "invalidsection"
+ 'The section parameter must be a valid section id or "new"', 'invalidsection'
);
}
} else {
);
}
} else {
@@
-109,13
+109,13
@@
class ApiParse extends ApiBase {
$titleObj = $rev->getTitle();
$wgTitle = $titleObj;
$pageObj = WikiPage::factory( $titleObj );
$titleObj = $rev->getTitle();
$wgTitle = $titleObj;
$pageObj = WikiPage::factory( $titleObj );
-
$popts
= $this->makeParserOptions( $pageObj, $params );
+
list( $popts, $reset, $suppressCache )
= $this->makeParserOptions( $pageObj, $params );
// If for some reason the "oldid" is actually the current revision, it may be cached
// Deliberately comparing $pageObj->getLatest() with $rev->getId(), rather than
// checking $rev->isCurrent(), because $pageObj is what actually ends up being used,
// and if its ->getLatest() is outdated, $rev->isCurrent() won't tell us that.
// If for some reason the "oldid" is actually the current revision, it may be cached
// Deliberately comparing $pageObj->getLatest() with $rev->getId(), rather than
// checking $rev->isCurrent(), because $pageObj is what actually ends up being used,
// and if its ->getLatest() is outdated, $rev->isCurrent() won't tell us that.
- if ( $rev->getId() == $pageObj->getLatest() ) {
+ if (
!$suppressCache &&
$rev->getId() == $pageObj->getLatest() ) {
// May get from/save to parser cache
$p_result = $this->getParsedContent( $pageObj, $popts,
$pageid, isset( $prop['wikitext'] ) );
// May get from/save to parser cache
$p_result = $this->getParsedContent( $pageObj, $popts,
$pageid, isset( $prop['wikitext'] ) );
@@
-131,9
+131,9
@@
class ApiParse extends ApiBase {
}
} else { // Not $oldid, but $pageid or $page
if ( $params['redirects'] ) {
}
} else { // Not $oldid, but $pageid or $page
if ( $params['redirects'] ) {
- $reqParams =
array(
+ $reqParams =
[
'redirects' => '',
'redirects' => '',
-
)
;
+
]
;
if ( !is_null( $pageid ) ) {
$reqParams['pageids'] = $pageid;
} else { // $page
if ( !is_null( $pageid ) ) {
$reqParams['pageids'] = $pageid;
} else { // $page
@@
-149,11
+149,11
@@
class ApiParse extends ApiBase {
foreach ( $pageSet->getRedirectTitles() as $title ) {
$to = $title->getFullText();
}
foreach ( $pageSet->getRedirectTitles() as $title ) {
$to = $title->getFullText();
}
- $pageParams =
array( 'title' => $to )
;
+ $pageParams =
[ 'title' => $to ]
;
} elseif ( !is_null( $pageid ) ) {
} elseif ( !is_null( $pageid ) ) {
- $pageParams =
array( 'pageid' => $pageid )
;
+ $pageParams =
[ 'pageid' => $pageid ]
;
} else { // $page
} else { // $page
- $pageParams =
array( 'title' => $page )
;
+ $pageParams =
[ 'title' => $page ]
;
}
$pageObj = $this->getTitleOrPageId( $pageParams, 'fromdb' );
}
$pageObj = $this->getTitleOrPageId( $pageParams, 'fromdb' );
@@
-167,12
+167,12
@@
class ApiParse extends ApiBase {
$oldid = $pageObj->getLatest();
}
$oldid = $pageObj->getLatest();
}
-
$popts
= $this->makeParserOptions( $pageObj, $params );
+
list( $popts, $reset, $suppressCache )
= $this->makeParserOptions( $pageObj, $params );
// Don't pollute the parser cache when setting options that aren't
// in ParserOptions::optionsHash()
/// @todo: This should be handled closer to the actual cache instead of here, see T110269
// Don't pollute the parser cache when setting options that aren't
// in ParserOptions::optionsHash()
/// @todo: This should be handled closer to the actual cache instead of here, see T110269
- $suppressCache =
+ $suppressCache =
$suppressCache ||
$params['disablepp'] ||
$params['disablelimitreport'] ||
$params['preview'] ||
$params['disablepp'] ||
$params['disablelimitreport'] ||
$params['preview'] ||
@@
-191,7
+191,7
@@
class ApiParse extends ApiBase {
} else { // Not $oldid, $pageid, $page. Hence based on $text
$titleObj = Title::newFromText( $title );
if ( !$titleObj || $titleObj->isExternal() ) {
} else { // Not $oldid, $pageid, $page. Hence based on $text
$titleObj = Title::newFromText( $title );
if ( !$titleObj || $titleObj->isExternal() ) {
- $this->dieUsageMsg(
array( 'invalidtitle', $title )
);
+ $this->dieUsageMsg(
[ 'invalidtitle', $title ]
);
}
$wgTitle = $titleObj;
if ( $titleObj->canExist() ) {
}
$wgTitle = $titleObj;
if ( $titleObj->canExist() ) {
@@
-202,7
+202,7
@@
class ApiParse extends ApiBase {
$pageObj = $article->getPage();
}
$pageObj = $article->getPage();
}
-
$popts
= $this->makeParserOptions( $pageObj, $params );
+
list( $popts, $reset )
= $this->makeParserOptions( $pageObj, $params );
$textProvided = !is_null( $text );
if ( !$textProvided ) {
$textProvided = !is_null( $text );
if ( !$textProvided ) {
@@
-245,7
+245,7
@@
class ApiParse extends ApiBase {
}
if ( $params['onlypst'] ) {
// Build a result and bail out
}
if ( $params['onlypst'] ) {
// Build a result and bail out
- $result_array =
array()
;
+ $result_array =
[]
;
$result_array['text'] = $this->pstContent->serialize( $format );
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text';
if ( isset( $prop['wikitext'] ) ) {
$result_array['text'] = $this->pstContent->serialize( $format );
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text';
if ( isset( $prop['wikitext'] ) ) {
@@
-272,10
+272,10
@@
class ApiParse extends ApiBase {
}
}
}
}
- $result_array =
array()
;
+ $result_array =
[]
;
$result_array['title'] = $titleObj->getPrefixedText();
$result_array['title'] = $titleObj->getPrefixedText();
- $result_array['pageid'] = $pageid ?
$pageid
: $pageObj->getId();
+ $result_array['pageid'] = $pageid ?: $pageObj->getId();
if ( !is_null( $oldid ) ) {
$result_array['revid'] = intval( $oldid );
if ( !is_null( $oldid ) ) {
$result_array['revid'] = intval( $oldid );
@@
-307,8
+307,8
@@
class ApiParse extends ApiBase {
if ( $params['effectivelanglinks'] ) {
// Link flags are ignored for now, but may in the future be
// included in the result.
if ( $params['effectivelanglinks'] ) {
// Link flags are ignored for now, but may in the future be
// included in the result.
- $linkFlags =
array()
;
- Hooks::run( 'LanguageLinks',
array( $titleObj, &$langlinks, &$linkFlags )
);
+ $linkFlags =
[]
;
+ Hooks::run( 'LanguageLinks',
[ $titleObj, &$langlinks, &$linkFlags ]
);
}
} else {
$langlinks = false;
}
} else {
$langlinks = false;
@@
-341,28
+341,32
@@
class ApiParse extends ApiBase {
}
if ( isset( $prop['displaytitle'] ) ) {
}
if ( isset( $prop['displaytitle'] ) ) {
- $result_array['displaytitle'] = $p_result->getDisplayTitle() ?
- $p_result->getDisplayTitle() :
+ $result_array['displaytitle'] = $p_result->getDisplayTitle() ?:
$titleObj->getPrefixedText();
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
$titleObj->getPrefixedText();
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
- $context =
$this->getContext(
);
+ $context =
new DerivativeContext( $this->getContext()
);
$context->setTitle( $titleObj );
$context->setTitle( $titleObj );
- $context->getOutput()->addParserOutputMetadata( $p_result );
+ $context->setWikiPage( $pageObj );
+
+ // We need an OutputPage tied to $context, not to the
+ // RequestContext at the root of the stack.
+ $output = new OutputPage( $context );
+ $output->addParserOutputMetadata( $p_result );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
- $css = $this->formatCss( $
context->getOutput()
->buildCssLinksArray() );
+ $css = $this->formatCss( $
output
->buildCssLinksArray() );
- $scripts =
array( $context->getOutput()->getHeadScripts() )
;
+ $scripts =
[ $output->getHeadScripts() ]
;
$result_array['headitems'] = array_merge( $headItems, $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
$result_array['headitems'] = array_merge( $headItems, $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
- $result_array['headhtml'] = $
context->getOutput()
->headElement( $context->getSkin() );
+ $result_array['headhtml'] = $
output
->headElement( $context->getSkin() );
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'headhtml';
}
}
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'headhtml';
}
}
@@
-372,7
+376,7
@@
class ApiParse extends ApiBase {
$result_array['modulescripts'] = array_values( array_unique( $p_result->getModuleScripts() ) );
$result_array['modulestyles'] = array_values( array_unique( $p_result->getModuleStyles() ) );
// To be removed in 1.27
$result_array['modulescripts'] = array_values( array_unique( $p_result->getModuleScripts() ) );
$result_array['modulestyles'] = array_values( array_unique( $p_result->getModuleStyles() ) );
// To be removed in 1.27
- $result_array['modulemessages'] =
array()
;
+ $result_array['modulemessages'] =
[]
;
$this->setWarning( 'modulemessages is deprecated since MediaWiki 1.26' );
}
$this->setWarning( 'modulemessages is deprecated since MediaWiki 1.26' );
}
@@
-390,9
+394,9
@@
class ApiParse extends ApiBase {
if ( isset( $prop['modules'] ) &&
!isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) {
if ( isset( $prop['modules'] ) &&
!isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) {
- $this->setWarning(
"Property 'modules' was set but not 'jsconfigvars' "
.
-
"or 'encodedjsconfigvars'. Configuration variables are necessary "
.
-
"for proper module usage."
);
+ $this->setWarning(
'Property "modules" was set but not "jsconfigvars" '
.
+
'or "encodedjsconfigvars". Configuration variables are necessary '
.
+
'for proper module usage.'
);
}
if ( isset( $prop['indicators'] ) ) {
}
if ( isset( $prop['indicators'] ) ) {
@@
-428,12
+432,12
@@
class ApiParse extends ApiBase {
if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) {
if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) {
- $this->dieUsage(
"parsetree is only supported for wikitext content", "notwikitext"
);
+ $this->dieUsage(
'parsetree is only supported for wikitext content', 'notwikitext'
);
}
$wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
$dom = $wgParser->preprocessToDom( $this->content->getNativeData() );
}
$wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
$dom = $wgParser->preprocessToDom( $this->content->getNativeData() );
- if ( is_callable(
array( $dom, 'saveXML' )
) ) {
+ if ( is_callable(
[ $dom, 'saveXML' ]
) ) {
$xml = $dom->saveXML();
} else {
$xml = $dom->__toString();
$xml = $dom->saveXML();
} else {
$xml = $dom->__toString();
@@
-442,7
+446,7
@@
class ApiParse extends ApiBase {
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree';
}
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree';
}
- $result_mapping =
array(
+ $result_mapping =
[
'redirects' => 'r',
'langlinks' => 'll',
'categories' => 'cl',
'redirects' => 'r',
'langlinks' => 'll',
'categories' => 'cl',
@@
-460,7
+464,7
@@
class ApiParse extends ApiBase {
'modulemessages' => 'm',
'properties' => 'pp',
'limitreportdata' => 'lr',
'modulemessages' => 'm',
'properties' => 'pp',
'limitreportdata' => 'lr',
-
)
;
+
]
;
$this->setIndexedTagNames( $result_array, $result_mapping );
$result->addValue( null, $this->getModuleName(), $result_array );
}
$this->setIndexedTagNames( $result_array, $result_mapping );
$result->addValue( null, $this->getModuleName(), $result_array );
}
@@
-471,10
+475,9
@@
class ApiParse extends ApiBase {
* @param WikiPage $pageObj
* @param array $params
*
* @param WikiPage $pageObj
* @param array $params
*
- * @return
ParserOptions
+ * @return
array [ ParserOptions, ScopedCallback, bool $suppressCache ]
*/
protected function makeParserOptions( WikiPage $pageObj, array $params ) {
*/
protected function makeParserOptions( WikiPage $pageObj, array $params ) {
-
$popts = $pageObj->makeParserOptions( $this->getContext() );
$popts->enableLimitReport( !$params['disablepp'] && !$params['disablelimitreport'] );
$popts->setIsPreview( $params['preview'] || $params['sectionpreview'] );
$popts = $pageObj->makeParserOptions( $this->getContext() );
$popts->enableLimitReport( !$params['disablepp'] && !$params['disablelimitreport'] );
$popts->setIsPreview( $params['preview'] || $params['sectionpreview'] );
@@
-484,7
+487,12
@@
class ApiParse extends ApiBase {
$popts->setTidy( false );
}
$popts->setTidy( false );
}
- return $popts;
+ $reset = null;
+ $suppressCache = false;
+ Hooks::run( 'ApiMakeParserOptions',
+ [ $popts, $pageObj->getTitle(), $params, $this, &$reset, &$suppressCache ] );
+
+ return [ $popts, $reset, $suppressCache ];
}
/**
}
/**
@@
-545,10
+553,10
@@
class ApiParse extends ApiBase {
// Not cached (save or load)
$section = $content->getSection( $this->section );
if ( $section === false ) {
// Not cached (save or load)
$section = $content->getSection( $this->section );
if ( $section === false ) {
- $this->dieUsage( "There is no section {$this->section} in
" . $what
, 'nosuchsection' );
+ $this->dieUsage( "There is no section {$this->section} in
$what"
, 'nosuchsection' );
}
if ( $section === null ) {
}
if ( $section === null ) {
- $this->dieUsage( "Sections are not supported by
" . $what
, 'nosuchsection' );
+ $this->dieUsage( "Sections are not supported by
$what"
, 'nosuchsection' );
$section = false;
}
$section = false;
}
@@
-581,9
+589,9
@@
class ApiParse extends ApiBase {
}
private function formatLangLinks( $links ) {
}
private function formatLangLinks( $links ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $links as $link ) {
foreach ( $links as $link ) {
- $entry =
array()
;
+ $entry =
[]
;
$bits = explode( ':', $link, 2 );
$title = Title::newFromText( $link );
$bits = explode( ':', $link, 2 );
$title = Title::newFromText( $link );
@@
-607,7
+615,7
@@
class ApiParse extends ApiBase {
}
private function formatCategoryLinks( $links ) {
}
private function formatCategoryLinks( $links ) {
- $result =
array()
;
+ $result =
[]
;
if ( !$links ) {
return $result;
if ( !$links ) {
return $result;
@@
-615,24
+623,24
@@
class ApiParse extends ApiBase {
// Fetch hiddencat property
$lb = new LinkBatch;
// Fetch hiddencat property
$lb = new LinkBatch;
- $lb->setArray(
array( NS_CATEGORY => $links )
);
+ $lb->setArray(
[ NS_CATEGORY => $links ]
);
$db = $this->getDB();
$db = $this->getDB();
- $res = $db->select(
array( 'page', 'page_props' )
,
-
array( 'page_title', 'pp_propname' )
,
+ $res = $db->select(
[ 'page', 'page_props' ]
,
+
[ 'page_title', 'pp_propname' ]
,
$lb->constructSet( 'page', $db ),
__METHOD__,
$lb->constructSet( 'page', $db ),
__METHOD__,
-
array()
,
- array( 'page_props' => array(
- 'LEFT JOIN',
array( 'pp_propname' => 'hiddencat', 'pp_page = page_id' )
- ) )
+
[]
,
+ [ 'page_props' => [
+ 'LEFT JOIN',
[ 'pp_propname' => 'hiddencat', 'pp_page = page_id' ]
+ ] ]
);
);
- $hiddencats =
array()
;
+ $hiddencats =
[]
;
foreach ( $res as $row ) {
$hiddencats[$row->page_title] = isset( $row->pp_propname );
}
foreach ( $links as $link => $sortkey ) {
foreach ( $res as $row ) {
$hiddencats[$row->page_title] = isset( $row->pp_propname );
}
foreach ( $links as $link => $sortkey ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['sortkey'] = $sortkey;
// array keys will cast numeric category names to ints, so cast back to string
ApiResult::setContentValue( $entry, 'category', (string)$link );
$entry['sortkey'] = $sortkey;
// array keys will cast numeric category names to ints, so cast back to string
ApiResult::setContentValue( $entry, 'category', (string)$link );
@@
-655,10
+663,10
@@
class ApiParse extends ApiBase {
}
private function formatLinks( $links ) {
}
private function formatLinks( $links ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $links as $ns => $nslinks ) {
foreach ( $nslinks as $title => $id ) {
foreach ( $links as $ns => $nslinks ) {
foreach ( $nslinks as $title => $id ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['ns'] = $ns;
ApiResult::setContentValue( $entry, 'title', Title::makeTitle( $ns, $title )->getFullText() );
$entry['exists'] = $id != 0;
$entry['ns'] = $ns;
ApiResult::setContentValue( $entry, 'title', Title::makeTitle( $ns, $title )->getFullText() );
$entry['exists'] = $id != 0;
@@
-670,10
+678,10
@@
class ApiParse extends ApiBase {
}
private function formatIWLinks( $iw ) {
}
private function formatIWLinks( $iw ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $iw as $prefix => $titles ) {
foreach ( array_keys( $titles ) as $title ) {
foreach ( $iw as $prefix => $titles ) {
foreach ( array_keys( $titles ) as $title ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['prefix'] = $prefix;
$title = Title::newFromText( "{$prefix}:{$title}" );
$entry['prefix'] = $prefix;
$title = Title::newFromText( "{$prefix}:{$title}" );
@@
-690,9
+698,9
@@
class ApiParse extends ApiBase {
}
private function formatHeadItems( $headItems ) {
}
private function formatHeadItems( $headItems ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $headItems as $tag => $content ) {
foreach ( $headItems as $tag => $content ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['tag'] = $tag;
ApiResult::setContentValue( $entry, 'content', $content );
$result[] = $entry;
$entry['tag'] = $tag;
ApiResult::setContentValue( $entry, 'content', $content );
$result[] = $entry;
@@
-702,9
+710,9
@@
class ApiParse extends ApiBase {
}
private function formatCss( $css ) {
}
private function formatCss( $css ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $css as $file => $link ) {
foreach ( $css as $file => $link ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['file'] = $file;
ApiResult::setContentValue( $entry, 'link', $link );
$result[] = $entry;
$entry['file'] = $file;
ApiResult::setContentValue( $entry, 'link', $link );
$result[] = $entry;
@@
-714,13
+722,13
@@
class ApiParse extends ApiBase {
}
private function formatLimitReportData( $limitReportData ) {
}
private function formatLimitReportData( $limitReportData ) {
- $result =
array()
;
+ $result =
[]
;
foreach ( $limitReportData as $name => $value ) {
foreach ( $limitReportData as $name => $value ) {
- $entry =
array()
;
+ $entry =
[]
;
$entry['name'] = $name;
if ( !is_array( $value ) ) {
$entry['name'] = $name;
if ( !is_array( $value ) ) {
- $value =
array( $value )
;
+ $value =
[ $value ]
;
}
ApiResult::setIndexedTagNameRecursive( $value, 'param' );
$entry = array_merge( $entry, $value );
}
ApiResult::setIndexedTagNameRecursive( $value, 'param' );
$entry = array_merge( $entry, $value );
@@
-739,25
+747,25
@@
class ApiParse extends ApiBase {
}
public function getAllowedParams() {
}
public function getAllowedParams() {
- return
array(
+ return
[
'title' => null,
'title' => null,
- 'text' =>
array(
+ 'text' =>
[
ApiBase::PARAM_TYPE => 'text',
ApiBase::PARAM_TYPE => 'text',
-
)
,
+
]
,
'summary' => null,
'page' => null,
'summary' => null,
'page' => null,
- 'pageid' =>
array(
+ 'pageid' =>
[
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_TYPE => 'integer',
-
)
,
+
]
,
'redirects' => false,
'redirects' => false,
- 'oldid' =>
array(
+ 'oldid' =>
[
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_TYPE => 'integer',
-
)
,
- 'prop' =>
array(
+
]
,
+ 'prop' =>
[
ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|' .
'images|externallinks|sections|revid|displaytitle|iwlinks|properties',
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|' .
'images|externallinks|sections|revid|displaytitle|iwlinks|properties',
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE =>
array(
+ ApiBase::PARAM_TYPE =>
[
'text',
'langlinks',
'categories',
'text',
'langlinks',
'categories',
@@
-781,46
+789,46
@@
class ApiParse extends ApiBase {
'limitreportdata',
'limitreporthtml',
'parsetree',
'limitreportdata',
'limitreporthtml',
'parsetree',
-
)
,
- ApiBase::PARAM_HELP_MSG_PER_VALUE =>
array(
- 'parsetree' =>
array( 'apihelp-parse-paramvalue-prop-parsetree', CONTENT_MODEL_WIKITEXT )
,
-
)
,
-
)
,
+
]
,
+ ApiBase::PARAM_HELP_MSG_PER_VALUE =>
[
+ 'parsetree' =>
[ 'apihelp-parse-paramvalue-prop-parsetree', CONTENT_MODEL_WIKITEXT ]
,
+
]
,
+
]
,
'pst' => false,
'onlypst' => false,
'effectivelanglinks' => false,
'section' => null,
'pst' => false,
'onlypst' => false,
'effectivelanglinks' => false,
'section' => null,
- 'sectiontitle' =>
array(
+ 'sectiontitle' =>
[
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_TYPE => 'string',
-
)
,
- 'disablepp' =>
array(
+
]
,
+ 'disablepp' =>
[
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DEPRECATED => true,
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DEPRECATED => true,
-
)
,
+
]
,
'disablelimitreport' => false,
'disableeditsection' => false,
'disabletidy' => false,
'disablelimitreport' => false,
'disableeditsection' => false,
'disabletidy' => false,
- 'generatexml' =>
array(
+ 'generatexml' =>
[
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DFLT => false,
- ApiBase::PARAM_HELP_MSG =>
array(
+ ApiBase::PARAM_HELP_MSG =>
[
'apihelp-parse-param-generatexml', CONTENT_MODEL_WIKITEXT
'apihelp-parse-param-generatexml', CONTENT_MODEL_WIKITEXT
-
)
,
+
]
,
ApiBase::PARAM_DEPRECATED => true,
ApiBase::PARAM_DEPRECATED => true,
-
)
,
+
]
,
'preview' => false,
'sectionpreview' => false,
'disabletoc' => false,
'preview' => false,
'sectionpreview' => false,
'disabletoc' => false,
- 'contentformat' =>
array(
+ 'contentformat' =>
[
ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
-
)
,
- 'contentmodel' =>
array(
+
]
,
+ 'contentmodel' =>
[
ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
- )
-
)
;
+ ]
+
]
;
}
protected function getExamplesMessages() {
}
protected function getExamplesMessages() {
- return
array(
+ return
[
'action=parse&page=Project:Sandbox'
=> 'apihelp-parse-example-page',
'action=parse&text={{Project:Sandbox}}&contentmodel=wikitext'
'action=parse&page=Project:Sandbox'
=> 'apihelp-parse-example-page',
'action=parse&text={{Project:Sandbox}}&contentmodel=wikitext'
@@
-829,7
+837,7
@@
class ApiParse extends ApiBase {
=> 'apihelp-parse-example-texttitle',
'action=parse&summary=Some+[[link]]&prop='
=> 'apihelp-parse-example-summary',
=> 'apihelp-parse-example-texttitle',
'action=parse&summary=Some+[[link]]&prop='
=> 'apihelp-parse-example-summary',
-
)
;
+
]
;
}
public function getHelpUrls() {
}
public function getHelpUrls() {