13require_once __DIR__ .
'/Maintenance.php';
25 parent::__construct();
27 $this->
addArg(
'oldlevel',
'Old name of restriction level',
true );
28 $this->
addArg(
'newlevel',
'New name of restriction level',
true );
32 $oldLevel = $this->
getArg( 0 );
33 $newLevel = $this->
getArg( 1 );
36 $dbw->newUpdateQueryBuilder()
37 ->update(
'page_restrictions' )
38 ->set( [
'pr_level' => $newLevel ] )
39 ->where( [
'pr_level' => $oldLevel ] )
40 ->caller( __METHOD__ )
42 $dbw->newUpdateQueryBuilder()
43 ->update(
'protected_titles' )
44 ->set( [
'pt_create_perm' => $newLevel ] )
45 ->where( [
'pt_create_perm' => $oldLevel ] )
46 ->caller( __METHOD__ )
54require_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.
getPrimaryDB(string|false $virtualDomain=false)
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.