Add maintenance.php to the tools

This commit is contained in:
Zankaria 2024-06-30 17:02:21 +02:00
parent d0b1c388eb
commit 03975a1bde

13
tools/maintenance.php Normal file
View file

@ -0,0 +1,13 @@
<?php
/**
* Performs maintenance tasks. Invoke this periodically if the auto_maintenance configuration option is turned off.
*/
require dirname(__FILE__) . '/inc/cli.php';
echo "Clearing expired bans...";
$start = microtime(true);
$deleted_count = Bans::purge($config['require_ban_view']);
$delta = microtime(true) - $start;
echo "Deleted $deleted_count expired bans in $delta seconds!";
modLog('Deleted expired bans using tools/maintenance.php');