Page MenuHomeWickedGov Phorge

batchCAAntiSpoof.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

batchCAAntiSpoof.php

<?php
// Go through all usernames and calculate and record spoof thingies
namespace MediaWiki\Extension\CentralAuth\Maintenance;
use BatchAntiSpoof;
use MediaWiki\Extension\CentralAuth\CentralAuthServices;
use MediaWiki\Extension\CentralAuth\User\CentralAuthSpoofUser;
use Wikimedia\Rdbms\IReadableDatabase;
$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
$IP = __DIR__ . '/../../..';
}
require_once "$IP/extensions/AntiSpoof/maintenance/BatchAntiSpoofClass.php";
class BatchCAAntiSpoof extends BatchAntiSpoof {
/**
* @param array $items
*/
protected function batchRecord( $items ) {
CentralAuthSpoofUser::batchRecord( CentralAuthServices::getDatabaseManager()->getCentralPrimaryDB(), $items );
}
/**
* @param int $db
* @param string|string[] $groups
* @param string|bool $wiki
* @return IReadableDatabase
* @suppress PhanParamSignatureMismatch
*/
protected function getDB( $db, $groups = [], $wiki = false ) {
if ( $db === DB_PRIMARY ) {
return CentralAuthServices::getDatabaseManager()->getCentralPrimaryDB();
} else {
return CentralAuthServices::getDatabaseManager()->getCentralReplicaDB();
}
}
/** @inheritDoc */
protected function getTableName() {
return 'globaluser';
}
/** @inheritDoc */
protected function getPrimaryKey() {
return 'gu_id';
}
/** @inheritDoc */
protected function getUserColumn() {
return 'gu_name';
}
/**
* @param string $name
* @return CentralAuthSpoofUser
*/
protected function makeSpoofUser( $name ) {
return CentralAuthServices::getAntiSpoofManager()->getSpoofUser( $name );
}
}
$maintClass = BatchCAAntiSpoof::class;
require_once RUN_MAINTENANCE_IF_MAIN;

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 04:36 (3 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a5/7c/a48899d8960a8332bc613e7a0e8d
Default Alt Text
batchCAAntiSpoof.php (1 KB)

Event Timeline