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
Use ::class to resolve class names in maintenance scripts
[lhc/web/wiklou.git]
/
maintenance
/
deleteBatch.php
diff --git
a/maintenance/deleteBatch.php
b/maintenance/deleteBatch.php
index
e8839c5
..
0f3c506
100644
(file)
--- a/
maintenance/deleteBatch.php
+++ b/
maintenance/deleteBatch.php
@@
-60,12
+60,12
@@
class DeleteBatch extends Maintenance {
$interval = $this->getOption( 'i', 0 );
if ( $username === false ) {
$interval = $this->getOption( 'i', 0 );
if ( $username === false ) {
- $user = User::newSystemUser( 'Delete page script',
array( 'steal' => true )
);
+ $user = User::newSystemUser( 'Delete page script',
[ 'steal' => true ]
);
} else {
$user = User::newFromName( $username );
}
if ( !$user ) {
} else {
$user = User::newFromName( $username );
}
if ( !$user ) {
- $this->
error( "Invalid username", true
);
+ $this->
fatalError( "Invalid username"
);
}
$wgUser = $user;
}
$wgUser = $user;
@@
-77,15
+77,14
@@
class DeleteBatch extends Maintenance {
# Setup
if ( !$file ) {
# Setup
if ( !$file ) {
- $this->
error( "Unable to read file, exiting", true
);
+ $this->
fatalError( "Unable to read file, exiting"
);
}
$dbw = $this->getDB( DB_MASTER );
# Handle each entry
}
$dbw = $this->getDB( DB_MASTER );
# Handle each entry
- //
@codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ //
phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
- // @codingStandardsIgnoreEnd
$line = trim( fgets( $file ) );
if ( $line == '' ) {
continue;
$line = trim( fgets( $file ) );
if ( $line == '' ) {
continue;
@@
-102,7
+101,7
@@
class DeleteBatch extends Maintenance {
$this->output( $title->getPrefixedText() );
if ( $title->getNamespace() == NS_FILE ) {
$this->output( $title->getPrefixedText() );
if ( $title->getNamespace() == NS_FILE ) {
- $img = wfFindFile( $title,
array( 'ignoreRedirect' => true )
);
+ $img = wfFindFile( $title,
[ 'ignoreRedirect' => true ]
);
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
$this->output( " FAILED to delete associated file... " );
}
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
$this->output( " FAILED to delete associated file... " );
}
@@
-124,5
+123,5
@@
class DeleteBatch extends Maintenance {
}
}
}
}
-$maintClass =
"DeleteBatch"
;
+$maintClass =
DeleteBatch::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;