* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
* @author Rob Church <robchur@gmail.com>
* @licence GNU General Public Licence 2.0 or later
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
+/**
+ * Maintenance script that reassigns edits from a user or IP address
+ * to another user.
+ *
+ * @ingroup Maintenance
+ */
class ReassignEdits extends Maintenance {
public function __construct() {
parent::__construct();
if ( $this->hasArg( 0 ) && $this->hasArg( 1 ) ) {
# Set up the users involved
$from = $this->initialiseUser( $this->getArg( 0 ) );
- $to = $this->initialiseUser( $this->getArg( 1 ) );
+ $to = $this->initialiseUser( $this->getArg( 1 ) );
# If the target doesn't exist, and --force is not set, stop here
if ( $to->getId() || $this->hasOption( 'force' ) ) {
*
* @param $from User to take edits from
* @param $to User to assign edits to
- * @param $rc Update the recent changes table
- * @param $report Don't change things; just echo numbers
+ * @param $rc bool Update the recent changes table
+ * @param $report bool Don't change things; just echo numbers
* @return integer Number of entries changed, or that would be changed
*/
private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->begin();
+ $dbw->begin( __METHOD__ );
# Count things
$this->output( "Checking current edits..." );
}
}
- $dbw->commit();
+ $dbw->commit( __METHOD__ );
return (int)$total;
}
/**
* Initialise the user object
*
- * @param $username Username or IP address
+ * @param $username string Username or IP address
* @return User
*/
private function initialiseUser( $username ) {
$user->load();
return $user;
}
-
-
}
$maintClass = "ReassignEdits";
-require_once( RUN_MAINTENANCE_IF_MAIN );
-
+require_once RUN_MAINTENANCE_IF_MAIN;