This commit is contained in:
Visman 2021-12-24 20:55:27 +07:00
parent 2bf8f6ba46
commit 94709ed753
2 changed files with 28 additions and 1 deletions

View file

@ -566,4 +566,31 @@ class Update extends Admin
return null;
}
/**
* rev.44 to rev.45
*/
protected function stageNumber44(array $args): ?int
{
if (! $this->c->DB->query('SELECT id FROM ::bbcode WHERE bb_tag=?s', ['from'])->fetchColumn()) {
$bbcodes = include $this->c->DIR_APP . '/config/defaultBBCode.php';
foreach ($bbcodes as $bbcode) {
if ('from' !== $bbcode['tag']) {
continue;
}
$vars = [
':tag' => $bbcode['tag'],
':structure' => \json_encode($bbcode, self::JSON_OPTIONS),
];
$query = 'INSERT INTO ::bbcode (bb_tag, bb_edit, bb_delete, bb_structure)
VALUES(?s:tag, 1, 0, ?s:structure)';
$this->c->DB->exec($query, $vars);
}
}
return null;
}
}

View file

@ -58,7 +58,7 @@ if (
}
$c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
$c->FORK_REVISION = 44;
$c->FORK_REVISION = 45;
$c->START = $forkStart;
$c->DIR_APP = __DIR__;
$c->DIR_PUBLIC = \realpath(__DIR__ . '/../public');