Update to Kirby 4.7.0
This commit is contained in:
parent
02a9ab387c
commit
ba25a9a198
509 changed files with 26604 additions and 14872 deletions
35
kirby/config/api/routes/kql.php
Normal file
35
kirby/config/api/routes/kql.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
return [
|
||||
'routes' => function ($kirby) {
|
||||
return [
|
||||
[
|
||||
'pattern' => 'query',
|
||||
'method' => 'POST|GET',
|
||||
'auth' => $kirby->option('kql.auth') !== false,
|
||||
'action' => function () use ($kirby) {
|
||||
$kql = '\Kirby\Kql\Kql';
|
||||
|
||||
if (class_exists($kql) === false) {
|
||||
return [
|
||||
'code' => 500,
|
||||
'status' => 'error',
|
||||
'message' => 'KQL plugin is not installed',
|
||||
];
|
||||
}
|
||||
|
||||
$input = $kirby->request()->get();
|
||||
$result = $kql::run($input);
|
||||
|
||||
return [
|
||||
'code' => 200,
|
||||
'result' => $result,
|
||||
'status' => 'ok',
|
||||
];
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
];
|
||||
// @codeCoverageIgnoreEnd
|
Loading…
Add table
Add a link
Reference in a new issue