Last Phase before v11 release. New Automation Cleanup

Last Phase before v11 release. New Automation Cleanup
This commit is contained in:
novgorodschi catalin
2026-07-23 11:49:27 +03:00
parent 9a3f26bc93
commit 8a2d727659
9 changed files with 288 additions and 3 deletions
+18
View File
@@ -85,6 +85,24 @@ if (!function_exists('admin_config_template_path')) {
$text = str_replace('%CRONTICK%', (string) $cronTick, $text);
}
// Retentiile de curatenie: la fel, editate din ACP, deci orice alt mod
// care regenereaza config.php trebuie sa le pastreze.
$cleanupDefaults = array(
'%CLEANUPREPORTS%' => array('CLEANUP_REPORTS_DAYS', 14),
'%CLEANUPCHAT%' => array('CLEANUP_CHAT_DAYS', 7),
'%CLEANUPMESSAGES%' => array('CLEANUP_MESSAGES_DAYS', 0),
);
foreach ($cleanupDefaults as $placeholder => $info) {
if (strpos($text, $placeholder) === false) {
continue;
}
list($constant, $default) = $info;
$value = defined($constant) ? (int) constant($constant) : $default;
$text = str_replace($placeholder, (string) $value, $text);
}
return $text;
}
}