Last cleanup run ?Cleanup runs once per hour from Automation and deletes in batches, so a first run on an old server catches up over several passes.
+
Last cleanup run ?Cleanup runs once per hour from Automation and deletes in batches, so a first run on an old server catches up over several passes.
Cron & Automation -> edit).
- $findReplace["%CRONLOOP%"] = 300;
- $findReplace["%CRONTICK%"] = 60;
- // Retentii implicite pentru curatenia periodica din Automation
- // (0 = regula dezactivata).
- $findReplace["%CLEANUPREPORTS%"] = 14;
- $findReplace["%CLEANUPCHAT%"] = 7;
- $findReplace["%CLEANUPMESSAGES%"] = 0;
+ // Setarile de cron si de curatenie vin acum din formularul de instalare
+ // (sectiunea CRON & AUTOMATION). Valorile sunt limitate aici, ca un
+ // formular trimis modificat sa nu scrie ceva absurd in config.php.
+ $cronLoop = isset($_POST['cron_loop']) ? (int) $_POST['cron_loop'] : 300;
+ $cronTick = isset($_POST['cron_tick']) ? (int) $_POST['cron_tick'] : 60;
+
+ if ($cronLoop < 0) { $cronLoop = 0; }
+ if ($cronLoop > 3300) { $cronLoop = 3300; }
+ if ($cronTick < 15) { $cronTick = 15; }
+ if ($cronTick > 900) { $cronTick = 900; }
+
+ // Un ciclu mai scurt decat un tick nu are sens: il tratam ca "o singura
+ // rulare per invocare".
+ if ($cronLoop > 0 && $cronLoop < $cronTick) { $cronLoop = 0; }
+
+ $findReplace["%CRONLOOP%"] = $cronLoop;
+ $findReplace["%CRONTICK%"] = $cronTick;
+
+ // Retentiile curateniei periodice (0 = regula dezactivata).
+ $cleanupFields = array(
+ "%CLEANUPREPORTS%" => array('cleanup_reports', 14),
+ "%CLEANUPCHAT%" => array('cleanup_chat', 7),
+ "%CLEANUPMESSAGES%" => array('cleanup_messages', 0),
+ );
+
+ foreach ($cleanupFields as $placeholder => $field) {
+ list($postName, $default) = $field;
+
+ $value = isset($_POST[$postName]) ? (int) $_POST[$postName] : $default;
+
+ if ($value < 0) { $value = 0; }
+ if ($value > 3650) { $value = 3650; }
+
+ $findReplace[$placeholder] = $value;
+ }
$findReplace["%DOMAIN%"] = $_POST['domain'];
$findReplace["%HOMEPAGE%"] = $_POST['homepage'];
$findReplace["%SERVER%"] = $_POST['server'];
diff --git a/install/templates/config.tpl b/install/templates/config.tpl
index 8e994457..b1f20bf0 100644
--- a/install/templates/config.tpl
+++ b/install/templates/config.tpl
@@ -296,6 +296,28 @@ foreach($mechs as $k => $l){
+
+ CRON & AUTOMATION
+
+
+
+
+
+
+
+
+ Automation runs from cron.php instead of players' page loads. One cron invocation keeps working for
+ "invocation length" seconds and processes a tick every "tick interval" seconds — so a host that only
+ allows a cron every 5 minutes still gets processing every minute. 0 days disables a cleanup rule;
+ reports archived by players are never deleted. All of these can be changed later from the admin panel.
+