mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-23 18:28:20 +00:00
Merge "PurgeOldLogIPData.php: Minor doc and code clean up"
This commit is contained in:
commit
1744abb0c7
|
@ -3,9 +3,8 @@
|
|||
namespace MediaWiki\Extension\AbuseFilter\Maintenance;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if ( getenv( 'MW_INSTALL_PATH' ) ) {
|
||||
$IP = getenv( 'MW_INSTALL_PATH' );
|
||||
} else {
|
||||
$IP = getenv( 'MW_INSTALL_PATH' );
|
||||
if ( $IP === false ) {
|
||||
$IP = __DIR__ . '/../../..';
|
||||
}
|
||||
require_once "$IP/maintenance/Maintenance.php";
|
||||
|
@ -18,7 +17,7 @@ use MWTimestamp;
|
|||
class PurgeOldLogIPData extends Maintenance {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->addDescription( 'Purge old IP Address data from AbuseFilter logs' );
|
||||
$this->addDescription( 'Purge old IP address data from the abuse_filter_log table' );
|
||||
$this->setBatchSize( 200 );
|
||||
|
||||
$this->requireExtension( 'Abuse Filter' );
|
||||
|
@ -28,7 +27,7 @@ class PurgeOldLogIPData extends Maintenance {
|
|||
* @inheritDoc
|
||||
*/
|
||||
public function execute() {
|
||||
$this->output( "Purging old IP Address data from abuse_filter_log...\n" );
|
||||
$this->output( "Purging old data from abuse_filter_log...\n" );
|
||||
$dbw = wfGetDB( DB_PRIMARY );
|
||||
$factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
|
||||
$cutoffUnix = (int)MWTimestamp::now( TS_UNIX ) - $this->getConfig()->get( 'AbuseFilterLogIPMaxAge' );
|
||||
|
|
Loading…
Reference in a new issue