X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateRestrictions.php;h=5b5cc04895575c677fed777d17ae1c64da4dbd90;hb=6e1291e30e52f9f77c40e6d8e6044fc105dae00f;hp=04e7f41c990fb070e2a44ba59feb3b42f423678e;hpb=67e23ec357d2265bc487bdd4b63e30fcaf5871c7;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index 04e7f41c99..5b5cc04895 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -24,8 +24,14 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; +/** + * Maintenance script that updates page_restrictions table from + * old page_restriction column. + * + * @ingroup Maintenance + */ class UpdateRestrictions extends Maintenance { public function __construct() { parent::__construct(); @@ -53,7 +59,12 @@ class UpdateRestrictions extends Maintenance { while ( $blockEnd <= $end ) { $this->output( "...doing page_id from $blockStart to $blockEnd\n" ); $cond = "page_id BETWEEN $blockStart AND $blockEnd AND page_restrictions !=''"; - $res = $db->select( 'page', array( 'page_id', 'page_namespace', 'page_restrictions' ), $cond, __METHOD__ ); + $res = $db->select( + 'page', + array( 'page_id', 'page_namespace', 'page_restrictions' ), + $cond, + __METHOD__ + ); $batch = array(); foreach ( $res as $row ) { $oldRestrictions = array(); @@ -102,10 +113,16 @@ class UpdateRestrictions extends Maintenance { // Kill any broken rows from previous imports $db->delete( 'page_restrictions', array( 'pr_level' => '' ) ); // Kill other invalid rows - $db->deleteJoin( 'page_restrictions', 'page', 'pr_page', 'page_id', array( 'page_namespace' => NS_MEDIAWIKI ) ); + $db->deleteJoin( + 'page_restrictions', + 'page', + 'pr_page', + 'page_id', + array( 'page_namespace' => NS_MEDIAWIKI ) + ); $this->output( "...Done!\n" ); } } $maintClass = "UpdateRestrictions"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;