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
|
<?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) {
|
||||||
$this->props = $config->getValues([
|
try {
|
||||||
['name:s', 'Misuzu'],
|
$this->props = $config->getValues([
|
||||||
'desc:s',
|
['name:s', 'Misuzu'],
|
||||||
'url:s',
|
'desc:s',
|
||||||
'ext_logo:s',
|
'url:s',
|
||||||
]);
|
'ext_logo:s',
|
||||||
|
]);
|
||||||
|
} catch(RuntimeException $ex) {
|
||||||
|
$this->props = [
|
||||||
|
'name' => 'Misuzu',
|
||||||
|
'desc' => '',
|
||||||
|
'url' => '',
|
||||||
|
'ext_logo' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string $name {
|
public string $name {
|
||||||
|
|
Loading…
Reference in a new issue