Fixed migrations being impossible to run on a clean database.

This commit is contained in:
Pachira 2024-12-17 20:32:09 +00:00
parent 3a0f27011d
commit 2e9adf0d06

View file

@ -1,18 +1,28 @@
<?php
namespace Misuzu;
use RuntimeException;
use Index\Config\Config;
class SiteInfo {
private array $props; // @phpstan-ignore-line: Seems PHPStan doesn't support property hooks yet :)
public function __construct(Config $config) {
$this->props = $config->getValues([
['name:s', 'Misuzu'],
'desc:s',
'url:s',
'ext_logo:s',
]);
try {
$this->props = $config->getValues([
['name:s', 'Misuzu'],
'desc:s',
'url:s',
'ext_logo:s',
]);
} catch(RuntimeException $ex) {
$this->props = [
'name' => 'Misuzu',
'desc' => '',
'url' => '',
'ext_logo' => '',
];
}
}
public string $name {