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 "wfEmptyMsg() was removed"
[lhc/web/wiklou.git]
/
maintenance
/
deleteBatch.php
diff --git
a/maintenance/deleteBatch.php
b/maintenance/deleteBatch.php
index
93507b3
..
6c89e67
100644
(file)
--- a/
maintenance/deleteBatch.php
+++ b/
maintenance/deleteBatch.php
@@
-55,11
+55,15
@@
class DeleteBatch extends Maintenance {
chdir( $oldCwd );
# Options processing
chdir( $oldCwd );
# Options processing
- $username = $this->getOption( 'u',
'Delete page script'
);
+ $username = $this->getOption( 'u',
false
);
$reason = $this->getOption( 'r', '' );
$interval = $this->getOption( 'i', 0 );
$reason = $this->getOption( 'r', '' );
$interval = $this->getOption( 'i', 0 );
- $user = User::newFromName( $username );
+ if ( $username === false ) {
+ $user = User::newSystemUser( 'Delete page script', array( 'steal' => true ) );
+ } else {
+ $user = User::newFromName( $username );
+ }
if ( !$user ) {
$this->error( "Invalid username", true );
}
if ( !$user ) {
$this->error( "Invalid username", true );
}
@@
-76,7
+80,7
@@
class DeleteBatch extends Maintenance {
$this->error( "Unable to read file, exiting", true );
}
$this->error( "Unable to read file, exiting", true );
}
- $dbw =
wfG
etDB( DB_MASTER );
+ $dbw =
$this->g
etDB( DB_MASTER );
# Handle each entry
// @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
# Handle each entry
// @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
@@
-97,7
+101,6
@@
class DeleteBatch extends Maintenance {
}
$this->output( $title->getPrefixedText() );
}
$this->output( $title->getPrefixedText() );
- $dbw->begin( __METHOD__ );
if ( $title->getNamespace() == NS_FILE ) {
$img = wfFindFile( $title, array( 'ignoreRedirect' => true ) );
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
if ( $title->getNamespace() == NS_FILE ) {
$img = wfFindFile( $title, array( 'ignoreRedirect' => true ) );
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
@@
-106,8
+109,7
@@
class DeleteBatch extends Maintenance {
}
$page = WikiPage::factory( $title );
$error = '';
}
$page = WikiPage::factory( $title );
$error = '';
- $success = $page->doDeleteArticle( $reason, false, 0, false, $error, $user );
- $dbw->commit( __METHOD__ );
+ $success = $page->doDeleteArticle( $reason, false, 0, true, $error, $user );
if ( $success ) {
$this->output( " Deleted!\n" );
} else {
if ( $success ) {
$this->output( " Deleted!\n" );
} else {