-<?php\r
-/**\r
- * Makes the required database updates for the log_user_text column\r
- *\r
- * Run via update.php or directly through populateLogUsertext.php\r
- *\r
- * @file\r
- * @ingroup Maintenance\r
- */\r
-\r
-define( 'LOG_USERTEXT_BATCH_SIZE', 100 );\r
-\r
-function populate_logusertext( $db ) {\r
- $start = $db->selectField( 'logging', 'MIN(log_id)', false, __FUNCTION__ );\r
- if( !$start ) {\r
- echo "Nothing to do.\n";\r
- return true;\r
- }\r
- $end = $db->selectField( 'logging', 'MAX(log_id)', false, __FUNCTION__ );\r
- \r
- # Do remaining chunk\r
- $end += LOG_USERTEXT_BATCH_SIZE - 1;\r
- $blockStart = $start;\r
- $blockEnd = $start + LOG_USERTEXT_BATCH_SIZE - 1;\r
- while( $blockEnd <= $end ) {\r
- echo "...doing log_id from $blockStart to $blockEnd\n";\r
- $cond = "log_id BETWEEN $blockStart AND $blockEnd AND log_user = user_id";\r
- $res = $db->select( array('logging','user'), \r
- array('log_id','user_name'), $cond, __FUNCTION__ );\r
- $batch = array();\r
- $db->begin();\r
- while( $row = $db->fetchObject( $res ) ) {\r
- $db->update( 'logging', array('log_user_text' => $row->user_name),\r
- array('log_id' => $row->log_id), __FUNCTION__ );\r
- }\r
- $db->commit();\r
- $blockStart += LOG_USERTEXT_BATCH_SIZE;\r
- $blockEnd += LOG_USERTEXT_BATCH_SIZE;\r
- wfWaitForSlaves( 5 );\r
- }\r
- if( $db->insert(\r
- 'updatelog',\r
- array( 'ul_key' => 'populate log_usertext' ),\r
- __FUNCTION__,\r
- 'IGNORE'\r
- )\r
- ) {\r
- wfOut( "log_usertext population complete.\n" );\r
- return true;\r
- } else {\r
- wfOut( "Could not insert log_usertext population row.\n" );\r
- return false;\r
- }\r
-}\r
+<?php
+/**
+ * Makes the required database updates for the log_user_text column
+ *
+ * Run via update.php or directly through populateLogUsertext.php
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+define( 'LOG_USERTEXT_BATCH_SIZE', 100 );
+
+function populate_logusertext( $db ) {
+ $start = $db->selectField( 'logging', 'MIN(log_id)', false, __FUNCTION__ );
+ if( !$start ) {
+ echo "Nothing to do.\n";
+ return true;
+ }
+ $end = $db->selectField( 'logging', 'MAX(log_id)', false, __FUNCTION__ );
+
+ # Do remaining chunk
+ $end += LOG_USERTEXT_BATCH_SIZE - 1;
+ $blockStart = $start;
+ $blockEnd = $start + LOG_USERTEXT_BATCH_SIZE - 1;
+ while( $blockEnd <= $end ) {
+ echo "...doing log_id from $blockStart to $blockEnd\n";
+ $cond = "log_id BETWEEN $blockStart AND $blockEnd AND log_user = user_id";
+ $res = $db->select( array('logging','user'),
+ array('log_id','user_name'), $cond, __FUNCTION__ );
+ $batch = array();
+ $db->begin();
+ while( $row = $db->fetchObject( $res ) ) {
+ $db->update( 'logging', array('log_user_text' => $row->user_name),
+ array('log_id' => $row->log_id), __FUNCTION__ );
+ }
+ $db->commit();
+ $blockStart += LOG_USERTEXT_BATCH_SIZE;
+ $blockEnd += LOG_USERTEXT_BATCH_SIZE;
+ wfWaitForSlaves( 5 );
+ }
+ if( $db->insert(
+ 'updatelog',
+ array( 'ul_key' => 'populate log_usertext' ),
+ __FUNCTION__,
+ 'IGNORE'
+ )
+ ) {
+ wfOut( "log_usertext population complete.\n" );
+ return true;
+ } else {
+ wfOut( "Could not insert log_usertext population row.\n" );
+ return false;
+ }
+}
-<?php\r
-/**\r
- * Makes the required database updates for Special:ProtectedPages\r
- * to show all protected pages, even ones before the page restrictions\r
- * schema change. All remaining page_restriction column values are moved\r
- * to the new table.\r
- *\r
- * @file\r
- * @ingroup Maintenance\r
- */\r
-\r
-require_once 'commandLine.inc';\r
-require_once 'populateLogUsertext.inc';\r
- \r
-$db =& wfGetDB( DB_MASTER );\r
-\r
-populate_logusertext( $db );\r
+<?php
+/**
+ * Makes the required database updates for Special:ProtectedPages
+ * to show all protected pages, even ones before the page restrictions
+ * schema change. All remaining page_restriction column values are moved
+ * to the new table.
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once 'commandLine.inc';
+require_once 'populateLogUsertext.inc';
+
+$db =& wfGetDB( DB_MASTER );
+
+populate_logusertext( $db );