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
Update wfGetDB calls in Maintenance scripts to use getDB()
[lhc/web/wiklou.git]
/
maintenance
/
storage
/
fixBug20757.php
diff --git
a/maintenance/storage/fixBug20757.php
b/maintenance/storage/fixBug20757.php
index
bfa269b
..
e926f56
100644
(file)
--- a/
maintenance/storage/fixBug20757.php
+++ b/
maintenance/storage/fixBug20757.php
@@
-42,8
+42,8
@@
class FixBug20757 extends Maintenance {
}
function execute() {
}
function execute() {
- $dbr =
wfG
etDB( DB_SLAVE );
- $dbw =
wfG
etDB( DB_MASTER );
+ $dbr =
$this->g
etDB( DB_SLAVE );
+ $dbw =
$this->g
etDB( DB_MASTER );
$dryRun = $this->getOption( 'dry-run' );
if ( $dryRun ) {
$dryRun = $this->getOption( 'dry-run' );
if ( $dryRun ) {
@@
-213,7
+213,7
@@
class FixBug20757 extends Maintenance {
if ( !$dryRun ) {
// Reset the text row to point to the original copy
if ( !$dryRun ) {
// Reset the text row to point to the original copy
- $
dbw->begin(
__METHOD__ );
+ $
this->beginTransaction( $dbw,
__METHOD__ );
$dbw->update(
'text',
// SET
$dbw->update(
'text',
// SET
@@
-241,7
+241,7
@@
class FixBug20757 extends Maintenance {
),
__METHOD__
);
),
__METHOD__
);
- $
dbw->commit(
__METHOD__ );
+ $
this->commitTransaction( $dbw,
__METHOD__ );
$this->waitForSlaves();
}
$this->waitForSlaves();
}
@@
-283,7
+283,7
@@
class FixBug20757 extends Maintenance {
unset( $this->mapCache[$key] );
}
unset( $this->mapCache[$key] );
}
- $dbr =
wfG
etDB( DB_SLAVE );
+ $dbr =
$this->g
etDB( DB_SLAVE );
$map = array();
$res = $dbr->select( 'revision',
array( 'rev_id', 'rev_text_id' ),
$map = array();
$res = $dbr->select( 'revision',
array( 'rev_id', 'rev_text_id' ),
@@
-296,6
+296,7
@@
class FixBug20757 extends Maintenance {
$this->mapCache[$pageId] = $map;
$this->mapCacheSize += count( $map );
}
$this->mapCache[$pageId] = $map;
$this->mapCacheSize += count( $map );
}
+
return $this->mapCache[$pageId];
}
return $this->mapCache[$pageId];
}
@@
-311,9
+312,9
@@
class FixBug20757 extends Maintenance {
$text = $secondaryRow->old_text;
if ( in_array( 'external', $flags ) ) {
$url = $text;
$text = $secondaryRow->old_text;
if ( in_array( 'external', $flags ) ) {
$url = $text;
-
wfS
uppressWarnings();
- list( /* $proto */
, $path ) = explode( '://', $url, 2 );
-
wfR
estoreWarnings();
+
MediaWiki\s
uppressWarnings();
+ list( /* $proto */, $path ) = explode( '://', $url, 2 );
+
MediaWiki\r
estoreWarnings();
if ( $path == "" ) {
return false;
if ( $path == "" ) {
return false;
@@
-341,6
+342,7
@@
class FixBug20757 extends Maintenance {
$obj->uncompress();
$text = $obj->getItem( $stub['hash'] );
$obj->uncompress();
$text = $obj->getItem( $stub['hash'] );
+
return $text !== false;
}
}
return $text !== false;
}
}