27require_once __DIR__ .
'/Maintenance.php';
39 parent::__construct();
41 $this->
addArg(
'oldlevel',
'Old name of restriction level',
true );
42 $this->
addArg(
'newlevel',
'New name of restriction level',
true );
46 $oldLevel = $this->
getArg( 0 );
47 $newLevel = $this->
getArg( 1 );
50 $dbw->newUpdateQueryBuilder()
51 ->update(
'page_restrictions' )
52 ->set( [
'pr_level' => $newLevel ] )
53 ->where( [
'pr_level' => $oldLevel ] )
54 ->caller( __METHOD__ )
56 $dbw->newUpdateQueryBuilder()
57 ->update(
'protected_titles' )
58 ->set( [
'pt_create_perm' => $newLevel ] )
59 ->where( [
'pt_create_perm' => $oldLevel ] )
60 ->caller( __METHOD__ )
68require_once RUN_MAINTENANCE_IF_MAIN;
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addArg( $arg, $description, $required=true, $multi=false)
Add some args that are needed.
getArg( $argId=0, $default=null)
Get an argument.
addDescription( $text)
Set the description text.
Maintenance script that updates page_restrictions and protected_titles tables to use a new name for a...
execute()
Do the actual work.
__construct()
Default constructor.