leftypol/tools/maintenance.php

21 lines
772 B
PHP
Raw Normal View History

2024-06-30 17:02:21 +02:00
<?php
/**
* Performs maintenance tasks. Invoke this periodically if the auto_maintenance configuration option is turned off.
*/
require dirname(__FILE__) . '/inc/cli.php';
2024-07-12 00:02:15 +02:00
echo "Clearing expired bans...\n";
2024-06-30 17:02:21 +02:00
$start = microtime(true);
$deleted_count = Bans::purge($config['require_ban_view'], $config['purge_bans']);
2024-06-30 17:02:21 +02:00
$delta = microtime(true) - $start;
2024-07-12 00:02:15 +02:00
echo "Deleted $deleted_count expired bans in $delta seconds!\n";
modLog("Deleted expired bans in {$delta}s with tools/maintenance.php");
2024-07-12 00:02:15 +02:00
echo "Clearing old antispam...\n";
$start = microtime(true);
$deleted_count = purge_old_antispam();
$delta = microtime(true) - $start;
2024-07-12 00:02:15 +02:00
echo "Deleted $deleted_count expired antispam in $delta seconds!\n";
modLog("Deleted expired antispam in {$delta}s with tools/maintenance.php");