// Have we already loaded our user input?
protected $mInputLoaded = false;
- // Batch size. If a script supports this, they should set
- // a default with setBatchSize()
+ /**
+ * Batch size. If a script supports this, they should set
+ * a default with setBatchSize()
+ *
+ * @var int
+ */
protected $mBatchSize = null;
// Generic options added by addDefaultParams()
* Perform a search index update with locking
* @param $maxLockTime Integer: the maximum time to keep the search index locked.
* @param $callback callback String: the function that will update the function.
- * @param $dbw Database object
+ * @param $dbw DatabaseBase object
* @param $results
*/
public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
require( dirname( __FILE__ ) . '/../commandLine.inc' );
class UpdateLogging {
+
+ /**
+ * @var DatabaseBase
+ */
var $dbw;
var $batchSize = 1000;
var $minTs = false;
* Do this inside a transaction
*
* @param $id Array of revision id values
- * @param $dbw Database class (needs to be a master)
+ * @param $dbw DatabaseBase class (needs to be a master)
*/
private function deleteRevs( $id, &$dbw ) {
if ( !is_array( $id ) )
/**
* May throw a database error if, say, the server dies during query.
- * @param $db Database object
+ * @param $db DatabaseBase object
* @param $id int The old_id
* @return String
*/
}
function revisionCallback( $params ) {
- $origTitle = $params['title'];
$title = $params['rctitle'];
$editTime = $params['timestamp'];
/**
* Get the checks that can easily be treated by non-speakers of the language.
- * @return A list of the easy checks.
+ * @return Array A list of the easy checks.
*/
protected function easyChecks() {
return array(
// portion equal to the first character, then remove the second
// character. This avoids having characters like U+A732 (double A)
// polluting the basic latin sort area.
- $prevWeights = array();
+
foreach ( $this->groups as $weight => $group ) {
if ( preg_match( '/(\.[0-9A-F]*)\./', $weight, $m ) ) {
if ( isset( $this->groups[$m[1]] ) ) {
*
* @param $code The language code.
*
- * @return The messages in this language.
+ * @return string The messages in this language.
*/
public function getMessages( $code ) {
$this->loadMessages( $code );
/**
* Rewrite a messages array.
*
+ * @param $languages
* @param $code The language code.
- * @param $write Write to the messages file?
- * @param $listUnknown List the unknown messages?
- * @param $removeUnknown Remove the unknown messages?
- * @param $removeDupes Remove the duplicated messages?
+ * @param bool $write Write to the messages file?
+ * @param bool $listUnknown List the unknown messages?
+ * @param bool $removeUnknown Remove the unknown messages?
+ * @param bool $removeDupes Remove the duplicated messages?
* @param $dupeMsgSource The source file intended to remove from the array.
*/
function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) {
*
* @param $oldMsgArray The input message array.
* @param $dupeMsgSource The source file path for duplicates.
- * @return $newMsgArray The output message array, with duplicates removed.
+ * @return Array $newMsgArray The output message array, with duplicates removed.
*/
function removeDupes( $oldMsgArray, $dupeMsgSource ) {
if ( file_exists( $dupeMsgSource ) ) {
/**
* Lock the appropriate tables for the script
- * @param $db Database object
+ * @param $db DatabaseBase object
* @param $extraTable String The name of any extra tables to lock (eg: text)
*/
private function lockTables( &$db, $extraTable = null ) {
* i.e. a user => id mapping, or a user_text => text mapping
*
* @param $user User for the condition
- * @param $idfield Field name containing the identifier
- * @param $utfield Field name containing the user text
+ * @param $idfield string Field name containing the identifier
+ * @param $utfield string Field name containing the user text
* @return array
*/
private function userConditions( &$user, $idfield, $utfield ) {
}
$count = 0;
- $row = false;
$batchConds = array();
do {
$this->output( 'Processing next ' . self::BATCH_SIZE . ' rows... ');