as upstream is inactive and has no plans to move to PHP 7.
* The old CategorizedRecentChanges feature, including its related configuration
option $wgAllowCategorizedRecentChanges, has been removed.
+* (T188472) The 'comma' value for $wgArticleCountMethod is no longer supported for
+ performance reasons, and installations with this setting will now work as if it
+ was configured with 'any'.
=== New features in 1.31 ===
* Wikimedia\Rdbms\IDatabase->select() and similar methods now support
*
* This variable can have the following values:
* - 'any': all pages as considered as valid articles
- * - 'comma': the page must contain a comma to be considered valid
* - 'link': the page must contain a [[wiki link]] to be considered valid
*
* See also See https://www.mediawiki.org/wiki/Manual:Article_count
if ( $config->get( 'ArticleCountMethod' ) == 'link' ) {
$tables[] = 'pagelinks';
$conds[] = 'pl_from=page_id';
- } elseif ( $config->get( 'ArticleCountMethod' ) == 'comma' ) {
- // To make a correct check for this, we would need, for each page,
- // to load the text, maybe uncompress it, maybe decode it and then
- // check if there's one comma.
- // But one thing we are sure is that if the page is empty, it can't
- // contain a comma :)
- $conds[] = 'page_len > 0';
}
$this->articles = $this->dbr->selectField(
return false;
}
- switch ( $wgArticleCountMethod ) {
- case 'any':
- return true;
- case 'comma':
- $text = $this->getNativeData();
- return strpos( $text, ',' ) !== false;
- case 'link':
- if ( $hasLinks === null ) { # not known, find out
- if ( !$title ) {
- $context = RequestContext::getMain();
- $title = $context->getTitle();
- }
-
- $po = $this->getParserOutput( $title, null, null, false );
- $links = $po->getLinks();
- $hasLinks = !empty( $links );
+ if ( $wgArticleCountMethod === 'link' ) {
+ if ( $hasLinks === null ) { # not known, find out
+ if ( !$title ) {
+ $context = RequestContext::getMain();
+ $title = $context->getTitle();
}
- return $hasLinks;
+ $po = $this->getParserOutput( $title, null, null, false );
+ $links = $po->getLinks();
+ $hasLinks = !empty( $links );
+ }
+
+ return $hasLinks;
}
- return false;
+ return true;
}
/**
'any',
true
],
- [ 'Foo',
- null,
- 'comma',
- false
- ],
- [ 'Foo, bar',
- null,
- 'comma',
- false
- ],
[ 'Foo',
null,
'link',
'any',
true
],
- [ '#REDIRECT [[bar]]',
- true,
- 'comma',
- false
- ],
[ '#REDIRECT [[bar]]',
true,
'link',
'any',
true
],
- [ 'Foo',
- null,
- 'comma',
- false
- ],
- [ 'Foo, bar',
- null,
- 'comma',
- false
- ],
];
}
'any',
true
],
- [ 'Foo',
- null,
- 'comma',
- false
- ],
- [ 'Foo, bar',
- null,
- 'comma',
- true
- ],
[ 'Foo',
null,
'link',
'any',
false
],
- [ '#REDIRECT [[bar]]',
- true,
- 'comma',
- false
- ],
[ '#REDIRECT [[bar]]',
true,
'link',
true
],
- // comma
- [ 'WikiPageTest_testIsCountable',
- CONTENT_MODEL_WIKITEXT,
- 'Foo',
- 'comma',
- false
- ],
- [ 'WikiPageTest_testIsCountable',
- CONTENT_MODEL_WIKITEXT,
- 'Foo, bar',
- 'comma',
- true
- ],
-
// link
[ 'WikiPageTest_testIsCountable',
CONTENT_MODEL_WIKITEXT,
'any',
false
],
- [ 'WikiPageTest_testIsCountable',
- CONTENT_MODEL_WIKITEXT,
- '#REDIRECT [[bar]]',
- 'comma',
- false
- ],
[ 'WikiPageTest_testIsCountable',
CONTENT_MODEL_WIKITEXT,
'#REDIRECT [[bar]]',
'any',
false
],
- [ 'Talk:WikiPageTest_testIsCountable',
- CONTENT_MODEL_WIKITEXT,
- 'Foo, bar',
- 'comma',
- false
- ],
[ 'Talk:WikiPageTest_testIsCountable',
CONTENT_MODEL_WIKITEXT,
'Foo [[bar]]',
'any',
false
],
- [ 'MediaWiki:WikiPageTest_testIsCountable.js',
- null,
- 'Foo, bar',
- 'comma',
- false
- ],
[ 'MediaWiki:WikiPageTest_testIsCountable.js',
null,
'Foo [[bar]]',
[ '$ 1.50' ],
[ '$ 3.00' ],
[ '$3.50' ],
- // Comma's sort after dots
+ // Commas sort after dots
// Not intentional but test to detect changes
[ '€ 2,99' ]
],