Added separate context class for forum stuff and split up handling of each object type.

This commit is contained in:
flash 2023-09-08 13:22:46 +00:00
parent 0971240ab1
commit a94b905116
24 changed files with 1853 additions and 1714 deletions

View file

@ -75,7 +75,7 @@ msz_sched_task_sql('Synchronise forum_id.', true,
'UPDATE msz_forum_posts AS p INNER JOIN msz_forum_topics AS t ON t.topic_id = p.topic_id SET p.forum_id = t.forum_id');
msz_sched_task_func('Recount forum topics and posts.', true, function() use ($msz) {
$msz->getForum()->syncForumCounters();
$msz->getForumContext()->getCategories()->syncForumCounters();
});
msz_sched_task_sql('Clean up expired 2fa tokens.', false,
@ -146,7 +146,7 @@ msz_sched_task_func('Recalculate permissions (maybe)...', false, function() use
return;
$msz->getConfig()->removeValues('perms.needsRecalc');
$msz->getPerms()->precalculatePermissions($msz->getForum());
$msz->getPerms()->precalculatePermissions($msz->getForumContext()->getCategories());
});
echo 'Running ' . count($schedTasks) . ' tasks...' . PHP_EOL;

View file

@ -5,4 +5,4 @@ namespace Misuzu;
require_once __DIR__ . '/../misuzu.php';
$msz->getConfig()->removeValues('perms.needsRecalc');
$msz->getPerms()->precalculatePermissions($msz->getForum());
$msz->getPerms()->precalculatePermissions($msz->getForumContext()->getCategories());