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
Improve some parameter docs
[lhc/web/wiklou.git]
/
maintenance
/
protect.php
diff --git
a/maintenance/protect.php
b/maintenance/protect.php
index
4a3148a
..
f6bb253
100644
(file)
--- a/
maintenance/protect.php
+++ b/
maintenance/protect.php
@@
-41,8
+41,8
@@
class Protect extends Maintenance {
}
public function execute() {
}
public function execute() {
- $userName = $this->getOption( 'u', false );
- $reason = $this->getOption( 'r', '' );
+ $userName = $this->getOption( 'u
ser
', false );
+ $reason = $this->getOption( 'r
eason
', '' );
$cascade = $this->hasOption( 'cascade' );
$cascade = $this->hasOption( 'cascade' );
@@
-54,7
+54,7
@@
class Protect extends Maintenance {
}
if ( $userName === false ) {
}
if ( $userName === false ) {
- $user = User::newSystemUser( 'Maintenance script',
array( 'steal' => true )
);
+ $user = User::newSystemUser( 'Maintenance script',
[ 'steal' => true ]
);
} else {
$user = User::newFromName( $userName );
}
} else {
$user = User::newFromName( $userName );
}
@@
-63,14
+63,14
@@
class Protect extends Maintenance {
}
// @todo FIXME: This is reset 7 lines down.
}
// @todo FIXME: This is reset 7 lines down.
- $restrictions =
array( 'edit' => $protection, 'move' => $protection )
;
+ $restrictions =
[ 'edit' => $protection, 'move' => $protection ]
;
$t = Title::newFromText( $this->getArg() );
if ( !$t ) {
$this->error( "Invalid title", true );
}
$t = Title::newFromText( $this->getArg() );
if ( !$t ) {
$this->error( "Invalid title", true );
}
- $restrictions =
array()
;
+ $restrictions =
[]
;
foreach ( $t->getRestrictionTypes() as $type ) {
$restrictions[$type] = $protection;
}
foreach ( $t->getRestrictionTypes() as $type ) {
$restrictions[$type] = $protection;
}
@@
-79,7
+79,7
@@
class Protect extends Maintenance {
$this->output( "Updating protection status... " );
$page = WikiPage::factory( $t );
$this->output( "Updating protection status... " );
$page = WikiPage::factory( $t );
- $status = $page->doUpdateRestrictions( $restrictions,
array()
, $cascade, $reason, $user );
+ $status = $page->doUpdateRestrictions( $restrictions,
[]
, $cascade, $reason, $user );
if ( $status->isOK() ) {
$this->output( "done\n" );
if ( $status->isOK() ) {
$this->output( "done\n" );