I want my config to load some data from environment variables. So I changed it like so:
<?php
function getenv_or_default($name, $default) {
$v = getenv($name);
if ($v !== false) {
return $v;
}
return $default;
}
return [
'debug' => true,
];
Just adding this (unused) definition breaks the app in weird ways: for example, now whenever I go to change a page status in the panel (draft → listed), I get a JSON output.
This took me way too long to figure out that it was because Kirby really doesn’t like functions to be defined in config.php