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
Change usages of $wgUser->getSkin() in special pages to use $this->getSkin()
[lhc/web/wiklou.git]
/
maintenance
/
initEditCount.php
diff --git
a/maintenance/initEditCount.php
b/maintenance/initEditCount.php
index
b95ef7b
..
0f13645
100644
(file)
--- a/
maintenance/initEditCount.php
+++ b/
maintenance/initEditCount.php
@@
-34,12
+34,11
@@
class InitEditCount extends Maintenance {
Background mode will be automatically used if the server is MySQL 4.0
(which does not support subqueries) or if multiple servers are listed
Background mode will be automatically used if the server is MySQL 4.0
(which does not support subqueries) or if multiple servers are listed
-in
$wgDBservers
, usually indicating a replication environment.' );
+in
the load balancer
, usually indicating a replication environment.' );
$this->mDescription = "Batch-recalculate user_editcount fields from the revision table";
}
public function execute() {
$this->mDescription = "Batch-recalculate user_editcount fields from the revision table";
}
public function execute() {
- global $wgDBservers;
$dbw = wfGetDB( DB_MASTER );
$user = $dbw->tableName( 'user' );
$revision = $dbw->tableName( 'revision' );
$dbw = wfGetDB( DB_MASTER );
$user = $dbw->tableName( 'user' );
$revision = $dbw->tableName( 'revision' );
@@
-47,9
+46,9
@@
in $wgDBservers, usually indicating a replication environment.' );
$dbver = $dbw->getServerVersion();
// Autodetect mode...
$dbver = $dbw->getServerVersion();
// Autodetect mode...
- $backgroundMode =
count( $wgDBservers
) > 1 ||
+ $backgroundMode =
wfGetLB()->getServerCount(
) > 1 ||
( $dbw instanceof DatabaseMysql && version_compare( $dbver, '4.1' ) < 0 );
( $dbw instanceof DatabaseMysql && version_compare( $dbver, '4.1' ) < 0 );
-
+
if ( $this->hasOption( 'background' ) ) {
$backgroundMode = true;
} elseif ( $this->hasOption( 'quick' ) ) {
if ( $this->hasOption( 'background' ) ) {
$backgroundMode = true;
} elseif ( $this->hasOption( 'quick' ) ) {
@@
-94,7
+93,7
@@
in $wgDBservers, usually indicating a replication environment.' );
$delta,
$rate ) );
$delta,
$rate ) );
- wfWaitForSlaves(
10
);
+ wfWaitForSlaves();
}
} else {
// Subselect should work on modern MySQLs etc
}
} else {
// Subselect should work on modern MySQLs etc
@@
-108,4
+107,4
@@
in $wgDBservers, usually indicating a replication environment.' );
}
$maintClass = "InitEditCount";
}
$maintClass = "InitEditCount";
-require_once(
DO_MAINTENANCE
);
+require_once(
RUN_MAINTENANCE_IF_MAIN
);