forked from gothinkster/realworld-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.php
62 lines (52 loc) · 1.9 KB
/
settings.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
// Define root path
defined('DS') ?: define('DS', DIRECTORY_SEPARATOR);
defined('ROOT') ?: define('ROOT', dirname(__DIR__) . DS);
// Load .env file
if (file_exists(ROOT . '.env')) {
$dotenv = new Dotenv\Dotenv(ROOT);
$dotenv->load();
}
return [
'settings' => [
'displayErrorDetails' => getenv('APP_DEBUG') === 'true' ? true : false, // set to false in production
'addContentLengthHeader' => false, // Allow the web server to send the content-length header
// App Settings
'app' => [
'name' => getenv('APP_NAME'),
'url' => getenv('APP_URL'),
'env' => getenv('APP_ENV'),
],
// Renderer settings
'renderer' => [
'template_path' => __DIR__ . '/../templates/',
],
// Monolog settings
'logger' => [
'name' => getenv('APP_NAME'),
'path' => isset($_ENV['docker']) ? 'php://stdout' : __DIR__ . '/../logs/app.log',
'level' => \Monolog\Logger::DEBUG,
],
// Database settings
'database' => [
'driver' => getenv('DB_CONNECTION'),
'host' => getenv('DB_HOST'),
'database' => getenv('DB_DATABASE'),
'username' => getenv('DB_USERNAME'),
'password' => getenv('DB_PASSWORD'),
'port' => getenv('DB_PORT'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
],
'cors' => null !== getenv('CORS_ALLOWED_ORIGINS') ? getenv('CORS_ALLOWED_ORIGINS') : '*',
// jwt settings
'jwt' => [
'secret' => getenv('JWT_SECRET'),
'secure' => false,
"header" => "Authorization",
"regexp" => "/Token\s+(.*)$/i",
'passthrough' => ['OPTIONS']
],
],
];