API Base App
This commit is contained in:
31
api/setup/settings/01_env.php
Normal file
31
api/setup/settings/01_env.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
return [
|
||||
'emails' => function() {
|
||||
$data = [
|
||||
'host' => $_ENV['EMAIL_HOST'],
|
||||
'username' => $_ENV['EMAIL_USERNAME'],
|
||||
'password' => $_ENV['EMAIL_PASSWORD'],
|
||||
'folder' => $_ENV['EMAIL_FOLDER'],
|
||||
];
|
||||
if (isset($_ENV['EMAIL_PORT'])) {
|
||||
$data['port'] = $_ENV['EMAIL_PORT'];
|
||||
}
|
||||
return json_decode(json_encode($data));
|
||||
},
|
||||
'passwords' => function() {
|
||||
return explode($_ENV['PASSWORDS_SEPARATOR'] ?? ',', $_ENV['PASSWORDS'] ?? '');
|
||||
},
|
||||
'api_key' => $_ENV['API_KEY'],
|
||||
'database' => function() {
|
||||
$arr = [
|
||||
'host' => 'db',
|
||||
'name' => $_ENV['MYSQL_DATABASE'],
|
||||
'username' => $_ENV['MYSQL_USER'],
|
||||
'password' => $_ENV['MYSQL_PASSWORD']
|
||||
];
|
||||
if (isset($_ENV['MYSQL_PORT'])) {
|
||||
$arr['port'] = $_ENV['MYSQL_PORT'];
|
||||
}
|
||||
return (object) $arr;
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user