Fixed migrations being impossible to run on a clean database.
This commit is contained in:
parent
3a0f27011d
commit
2e9adf0d06
1 changed files with 16 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue