Unofficial SMF API Documentation

./Sources/RepairBoards.php

RepairBoards

function RepairBoards(): void

Finds or repairs errors in the database to fix possible problems.

Requires the admin_forum permission. Calls createSalvageArea() to create a new board, if necessary. Accessed by ?action=admin;area=repairboards.

pauseRepairProcess

function pauseRepairProcess(array $to_fix, string $current_step_description, int $max_substep = 0, bool $force = false): void

Show the not_done template to avoid CGI timeouts and similar.

Called when 3 or more seconds have passed while searching for errors. If max_substep is set, $_GET[‘substep’] / $max_substep is the percent done this step is.

Type Parameter Description
array $to_fix An array of information about what to fix
string $current_step_description The description of the current step
int $max_substep The maximum substep to reach before pausing
bool $force Whether to force pausing even if we don’t really need to

loadForumTests

function loadForumTests(): void

Load up all the tests we might want to do ;)

findForumErrors

function findForumErrors(bool $do_fix = false): array

Checks for errors in steps, until 5 seconds have passed.

It keeps track of the errors it did find, so that the actual repair won’t have to recheck everything.

Type Parameter Description
bool $do_fix Whether to actually fix the errors or just return the info

createSalvageArea

function createSalvageArea(): void

Create a salvage area for repair purposes, if one doesn’t already exist.

Uses the forum’s default language, and checks based on that name.

Suggest an edit to this page on GitHub