Skip to content

Commit e83a7e6

Browse files
authored
Merge pull request #49 from splorp/k5
K5
2 parents 3a6a4d5 + 01472a8 commit e83a7e6

File tree

487 files changed

+39461
-10495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+39461
-10495
lines changed

content/04_changes/changes.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ Incremental changes are listed in the project’s [commit history](https://githu
1818

1919
Recently added terms and sources can be found on the (link: /latest text: Latest Additions) page.
2020

21+
### _$r
22+
23+
Terms: _$t
24+
Sources: _$s
25+
26+
#### Summary of changes:
27+
28+
+ Updated [Kirby](https://getkirby.com/) to version [5.0.0](https://github.com/getkirby/kirby/releases/tag/5.0.0)
29+
+ Updated [Kirby Paperback Export](https://github.com/splorp/kirby-paperback-export) plugin to version [2.0.7](https://github.com/splorp/kirby-paperback-export/releases/tag/2.0.7)
30+
+ Updated [Kirby Redirects](https://github.com/bnomei/kirby3-redirects) plugin to version [5.0.0](https://github.com/bnomei/kirby3-redirects/releases/tag/v5.0.0)
31+
2132
### 4.6.0
2233

2334
25 June 2025

content/site.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,4 @@ Powered by (link: https://getkirby.com/ text: Kirby title: The CMS that adapts t
161161

162162
----
163163

164-
Version: 4.6.0
164+
Release: 5.0.0

kirby/bootstrap.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* stop at older or too recent versions
66
*/
77
if (
8-
version_compare(PHP_VERSION, '8.1.0', '>=') === false ||
8+
version_compare(PHP_VERSION, '8.2.0', '>=') === false ||
99
version_compare(PHP_VERSION, '8.5.0', '<') === false
1010
) {
1111
die(include __DIR__ . '/views/php.php');
@@ -27,10 +27,9 @@
2727
* @psalm-suppress MissingFile
2828
*/
2929
include $autoloader;
30-
} else {
31-
/**
32-
* If neither one exists, don't bother searching;
33-
* it's a custom directory setup and the users need to
34-
* load the autoloader themselves
35-
*/
3630
}
31+
/**
32+
* If neither one exists, don't bother searching;
33+
* it's a custom directory setup and the users need to
34+
* load the autoloader themselves
35+
*/

kirby/composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "The Kirby core",
44
"license": "proprietary",
55
"type": "kirby-cms",
6-
"version": "4.8.0",
6+
"version": "5.0.0",
77
"keywords": [
88
"kirby",
99
"cms",
@@ -24,7 +24,7 @@
2424
"source": "https://github.com/getkirby/kirby"
2525
},
2626
"require": {
27-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
27+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
2828
"ext-SimpleXML": "*",
2929
"ext-ctype": "*",
3030
"ext-curl": "*",
@@ -39,14 +39,14 @@
3939
"christian-riesen/base32": "1.6.0",
4040
"claviska/simpleimage": "4.2.1",
4141
"composer/semver": "3.4.3",
42-
"filp/whoops": "2.18.0",
42+
"filp/whoops": "2.18.3",
4343
"getkirby/composer-installer": "^1.2.1",
4444
"laminas/laminas-escaper": "2.17.0",
4545
"michelf/php-smartypants": "1.8.1",
4646
"phpmailer/phpmailer": "6.10.0",
4747
"symfony/polyfill-intl-idn": "1.32.0",
4848
"symfony/polyfill-mbstring": "1.32.0",
49-
"symfony/yaml": "6.4.21"
49+
"symfony/yaml": "7.3.0"
5050
},
5151
"replace": {
5252
"symfony/polyfill-php72": "*"
@@ -58,6 +58,7 @@
5858
"ext-fileinfo": "Improved mime type detection for files",
5959
"ext-intl": "Improved i18n number formatting",
6060
"ext-memcached": "Support for the Memcached cache driver",
61+
"ext-redis": "Support for the Redis cache driver",
6162
"ext-sodium": "Support for the crypto class and more robust session handling",
6263
"ext-zip": "Support for ZIP archive file functions",
6364
"ext-zlib": "Sanitization and validation for svgz files"
@@ -80,7 +81,7 @@
8081
},
8182
"optimize-autoloader": true,
8283
"platform": {
83-
"php": "8.1.0"
84+
"php": "8.2.0"
8485
},
8586
"platform-check": false
8687
},

kirby/composer.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kirby/config/aliases.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,16 @@
7575
// Any of these might be removed at any point in the future
7676
'kirby\cms\asset' => 'Kirby\Filesystem\Asset',
7777
'kirby\cms\content' => 'Kirby\Content\Content',
78-
'kirby\cms\contenttranslation' => 'Kirby\Content\ContentTranslation',
7978
'kirby\cms\dir' => 'Kirby\Filesystem\Dir',
8079
'kirby\cms\filename' => 'Kirby\Filesystem\Filename',
8180
'kirby\cms\filefoundation' => 'Kirby\Filesystem\IsFile',
8281
'kirby\cms\field' => 'Kirby\Content\Field',
8382
'kirby\cms\form' => 'Kirby\Form\Form',
8483
'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag',
8584
'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags',
85+
'kirby\cms\plugin' => 'Kirby\Plugin\Plugin',
86+
'kirby\cms\pluginasset' => 'Kirby\Plugin\Asset',
87+
'kirby\cms\pluginassets' => 'Kirby\Plugin\Assets',
8688
'kirby\cms\template' => 'Kirby\Template\Template',
8789
'kirby\form\options' => 'Kirby\Option\Options',
8890
'kirby\form\optionsapi' => 'Kirby\Option\OptionsApi',

kirby/config/api/authentication.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
$auth->type($allowImpersonation) === 'session' &&
1212
$auth->csrf() === false
1313
) {
14-
throw new AuthException('Unauthenticated');
14+
throw new AuthException(message: 'Unauthenticated');
1515
}
1616

1717
// get user from session or basic auth
1818
if ($user = $auth->user(null, $allowImpersonation)) {
1919
if ($user->role()->permissions()->for('access', 'panel') === false) {
20-
throw new AuthException(['key' => 'access.panel']);
20+
throw new AuthException(key: 'access.panel');
2121
}
2222

2323
return $user;
2424
}
2525

26-
throw new AuthException('Unauthenticated');
26+
throw new AuthException(message: 'Unauthenticated');
2727
};

kirby/config/api/routes.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
* Api Routes Definitions
55
*/
66
return function ($kirby) {
7-
$routes = array_merge(
8-
include __DIR__ . '/routes/auth.php',
9-
include __DIR__ . '/routes/pages.php',
10-
include __DIR__ . '/routes/roles.php',
11-
include __DIR__ . '/routes/site.php',
12-
include __DIR__ . '/routes/users.php',
13-
include __DIR__ . '/routes/files.php',
14-
include __DIR__ . '/routes/lock.php',
15-
include __DIR__ . '/routes/system.php',
16-
include __DIR__ . '/routes/translations.php'
17-
);
7+
$routes = [
8+
...include __DIR__ . '/routes/auth.php',
9+
...include __DIR__ . '/routes/changes.php',
10+
...include __DIR__ . '/routes/pages.php',
11+
...include __DIR__ . '/routes/roles.php',
12+
...include __DIR__ . '/routes/site.php',
13+
...include __DIR__ . '/routes/users.php',
14+
...include __DIR__ . '/routes/files.php',
15+
...include __DIR__ . '/routes/system.php',
16+
...include __DIR__ . '/routes/translations.php'
17+
];
1818

1919
// only add the language routes if the
2020
// multi language setup is activated
2121
if ($kirby->option('languages', false) !== false) {
22-
$routes = array_merge(
23-
$routes,
24-
include __DIR__ . '/routes/languages.php'
25-
);
22+
$routes = [
23+
...$routes,
24+
...include __DIR__ . '/routes/languages.php'
25+
];
2626
}
2727

2828
return $routes;

kirby/config/api/routes/auth.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
return $this->resolve($user)->view('auth');
1616
}
1717

18-
throw new NotFoundException('The user cannot be found');
18+
throw new NotFoundException(
19+
message: 'The user cannot be found'
20+
);
1921
}
2022
],
2123
[
@@ -27,7 +29,9 @@
2729

2830
// csrf token check
2931
if ($auth->type() === 'session' && $auth->csrf() === false) {
30-
throw new InvalidArgumentException('Invalid CSRF token');
32+
throw new InvalidArgumentException(
33+
message: 'Invalid CSRF token'
34+
);
3135
}
3236

3337
$user = $auth->verifyChallenge($this->requestBody('code'));
@@ -49,7 +53,9 @@
4953

5054
// csrf token check
5155
if ($auth->type() === 'session' && $auth->csrf() === false) {
52-
throw new InvalidArgumentException('Invalid CSRF token');
56+
throw new InvalidArgumentException(
57+
message: 'Invalid CSRF token'
58+
);
5359
}
5460

5561
$email = $this->requestBody('email');
@@ -58,7 +64,9 @@
5864

5965
if ($password) {
6066
if (isset($methods['password']) !== true) {
61-
throw new InvalidArgumentException('Login with password is not enabled');
67+
throw new InvalidArgumentException(
68+
message: 'Login with password is not enabled'
69+
);
6270
}
6371

6472
if (
@@ -73,7 +81,9 @@
7381
$mode = match (true) {
7482
isset($methods['code']) => 'login',
7583
isset($methods['password-reset']) => 'password-reset',
76-
default => throw new InvalidArgumentException('Login without password is not enabled')
84+
default => throw new InvalidArgumentException(
85+
message: 'Login without password is not enabled'
86+
)
7787
};
7888

7989
$status = $auth->createChallenge($email, $long, $mode);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use Kirby\Api\Controller\Changes;
4+
use Kirby\Cms\App;
5+
use Kirby\Cms\Find;
6+
7+
return [
8+
[
9+
'pattern' => '(:all)/changes/discard',
10+
'method' => 'POST',
11+
'action' => function (string $path) {
12+
return Changes::discard(
13+
model: Find::parent($path),
14+
);
15+
}
16+
],
17+
[
18+
'pattern' => '(:all)/changes/publish',
19+
'method' => 'POST',
20+
'action' => function (string $path) {
21+
return Changes::publish(
22+
model: Find::parent($path),
23+
input: App::instance()->request()->get()
24+
);
25+
}
26+
],
27+
[
28+
'pattern' => '(:all)/changes/save',
29+
'method' => 'POST',
30+
'action' => function (string $path) {
31+
return Changes::save(
32+
model: Find::parent($path),
33+
input: App::instance()->request()->get()
34+
);
35+
}
36+
],
37+
];

0 commit comments

Comments
 (0)