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