Update to Kirby 5

This commit is contained in:
Paul Nicoué 2025-07-11 14:41:34 +02:00
parent 5d9979fca8
commit 0fefc5e2e1
472 changed files with 30853 additions and 10301 deletions

View file

@ -31,18 +31,6 @@ return [
];
}
],
[
'pattern' => 'system/method-test',
'method' => 'PATCH',
'action' => function () {
return [
'status' => match ($this->kirby()->request()->method()) {
'PATCH' => 'ok',
default => 'fail'
}
];
}
],
[
'pattern' => 'system/register',
'method' => 'POST',
@ -60,19 +48,27 @@ return [
// csrf token check
if ($auth->type() === 'session' && $auth->csrf() === false) {
throw new InvalidArgumentException('Invalid CSRF token');
throw new InvalidArgumentException(
message: 'Invalid CSRF token'
);
}
if ($system->isOk() === false) {
throw new Exception('The server is not setup correctly');
throw new Exception(
message: 'The server is not setup correctly'
);
}
if ($system->isInstallable() === false) {
throw new Exception('The Panel cannot be installed');
throw new Exception(
message: 'The Panel cannot be installed'
);
}
if ($system->isInstalled() === true) {
throw new Exception('The Panel is already installed');
throw new Exception(
message: 'The Panel is already installed'
);
}
// create the first user