From 0ba3537aadd1d97cbac14026365c31d3078f1bcd Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 5 Jan 2006 23:21:32 +0000 Subject: [PATCH] * 80 chars width * comments functions using phpdoc format --- maintenance/removeUnusedAccounts.inc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/maintenance/removeUnusedAccounts.inc b/maintenance/removeUnusedAccounts.inc index 74f5420cb9..376b6c9f81 100644 --- a/maintenance/removeUnusedAccounts.inc +++ b/maintenance/removeUnusedAccounts.inc @@ -11,11 +11,16 @@ define( 'ACTION_REPORT', 0 ); define( 'ACTION_DELETE', 1 ); -# Count the number of edits the specified user has made +/** + * Count the number of edits the specified user has made + * @param $user_id A database user id. + * @return integer Number of edits made by the given user. + */ function CountEdits( $user_id ) { - # We've *got* to pull this stuff off the master. If the user *has* made an edit, but it hasn't - # been replicated to the slaves yet, we'll end up falsely marking them as inactive. This could - # (and usually would) lead to their deletion. + # We've *got* to pull this stuff off the master. If the user *has* made + # an edit, but it hasn't been replicated to the slaves yet, we'll end up + # falsely marking them as inactive. This could (and usually would) lead + # to their deletion. $dbw =& wfGetDB( DB_MASTER ); $sql = 'SELECT COUNT(rev_id) AS count FROM ' . $dbw->tableName( 'revision' ) . ' WHERE rev_user = ' . $user_id; $res = $dbw->query( $sql ); @@ -23,7 +28,10 @@ function CountEdits( $user_id ) { return( $row->count ); } -# Return an array containing all valid user IDs +/** + * Return an array containing all valid user IDs + * @return array Array of User:: object(s). + */ function GetUsers() { # We're safe enough pulling this off a slave $dbr =& wfGetDB( DB_SLAVE ); @@ -36,7 +44,11 @@ function GetUsers() { return( $users ); } -# Delete one or more users +/** + * Delete one or more users. + * You will probably use GetUsers() first to get a list of users :o) + * @param array An array of User:: object(s) + */ function DeleteUsers( $users ) { # Need a master, obviously $dbw =& wfGetDB( DB_MASTER ); @@ -49,4 +61,4 @@ function DeleteUsers( $users ) { $dbw->commit(); } -?> \ No newline at end of file +?> -- 2.20.1