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 "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git]
/
maintenance
/
compareParserCache.php
diff --git
a/maintenance/compareParserCache.php
b/maintenance/compareParserCache.php
index
e5f0bb3
..
504c7d7
100644
(file)
--- a/
maintenance/compareParserCache.php
+++ b/
maintenance/compareParserCache.php
@@
-21,6
+21,8
@@
require_once __DIR__ . '/Maintenance.php';
require_once __DIR__ . '/Maintenance.php';
+use MediaWiki\MediaWikiServices;
+
/**
* @ingroup Maintenance
*/
/**
* @ingroup Maintenance
*/
@@
-35,23
+37,24
@@
class CompareParserCache extends Maintenance {
public function execute() {
$pages = $this->getOption( 'maxpages' );
public function execute() {
$pages = $this->getOption( 'maxpages' );
- $dbr = $this->getDB( DB_
SLAVE
);
+ $dbr = $this->getDB( DB_
REPLICA
);
$totalsec = 0.0;
$scanned = 0;
$withcache = 0;
$withdiff = 0;
$totalsec = 0.0;
$scanned = 0;
$withcache = 0;
$withdiff = 0;
+ $parserCache = MediaWikiServices::getInstance()->getParserCache();
while ( $pages-- > 0 ) {
$row = $dbr->selectRow( 'page', '*',
while ( $pages-- > 0 ) {
$row = $dbr->selectRow( 'page', '*',
- array(
+ [
'page_namespace' => $this->getOption( 'namespace' ),
'page_is_redirect' => 0,
'page_random >= ' . wfRandom()
'page_namespace' => $this->getOption( 'namespace' ),
'page_is_redirect' => 0,
'page_random >= ' . wfRandom()
-
)
,
+
]
,
__METHOD__,
__METHOD__,
- array(
+ [
'ORDER BY' => 'page_random',
'ORDER BY' => 'page_random',
- )
+ ]
);
if ( !$row ) {
);
if ( !$row ) {
@@
-66,7
+69,7
@@
class CompareParserCache extends Maintenance {
$parserOptions = $page->makeParserOptions( 'canonical' );
$parserOptions = $page->makeParserOptions( 'canonical' );
- $parserOutputOld =
ParserCache::singleton()
->get( $page, $parserOptions );
+ $parserOutputOld =
$parserCache
->get( $page, $parserOptions );
if ( $parserOutputOld ) {
$t1 = microtime( true );
if ( $parserOutputOld ) {
$t1 = microtime( true );