-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
35 lines (33 loc) · 1.1 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
@include_once __DIR__ . '/vendor/autoload.php';
@include_once __DIR__ . '/global.php';
Kirby::plugin('bnomei/dotenv', [
'options' => [
'dir' => function (): string {
return kirby()->roots()->index();
// return realpath(kirby()->roots()->index() . '/../'); // public folder setup
},
'file' => '.env',
'required' => [],
'setup' => function ($dotenv) {
// overwrite to do additional tasks
return $dotenv;
}
],
'pageMethods' => [
'env' => function (string $env, mixed $default = null) {
return \Bnomei\DotEnv::getenv($env, $default);
},
'getenv' => function (string $env, mixed $default = null) {
return \Bnomei\DotEnv::getenv($env, $default);
},
],
'siteMethods' => [
'env' => function (string $env, mixed $default = null) {
return \Bnomei\DotEnv::getenv($env, $default);
},
'getenv' => function (string $env, mixed $default = null) {
return \Bnomei\DotEnv::getenv($env, $default);
},
],
]);