This commit is contained in:
James Cole 2018-04-27 06:26:37 +02:00
parent 9026c9d6f1
commit a9dd8eb9e7
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
7 changed files with 41 additions and 26 deletions

View File

@ -36,6 +36,21 @@ declare(strict_types=1);
bcscale(12);
/**
* @param string $key
* @param null $default
*
* @return mixed|null
*/
function envNonEmpty(string $key, $default = null)
{
$result = env($key, $default);
if (is_string($result) && $result === '') {
$result = $default;
}
return $result;
}
$app = new Illuminate\Foundation\Application(
realpath(__DIR__ . '/../')

View File

@ -23,17 +23,17 @@ declare(strict_types=1);
return [
'name' => env('APP_NAME', 'Firefly III'),
'env' => env('APP_ENV', 'production'),
'name' => envNonEmpty('APP_NAME', 'Firefly III'),
'env' => envNonEmpty('APP_ENV', 'production'),
'debug' => env('APP_DEBUG', false),
'url' => env('APP_URL', 'http://localhost'),
'timezone' => env('TZ', 'UTC'),
'url' => envNonEmpty('APP_URL', 'http://localhost'),
'timezone' => envNonEmpty('TZ', 'UTC'),
'locale' => 'en_US',
'fallback_locale' => 'en_US',
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
'log' => env('APP_LOG', 'errorlog'),
'log_level' => env('APP_LOG_LEVEL', 'info'),
'log' => envNonEmpty('APP_LOG', 'errorlog'),
'log_level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
'providers' => [
/*

View File

@ -37,7 +37,7 @@ return [
|
*/
'default' => env('CACHE_DRIVER', 'file'),
'default' => envNonEmpty('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------

View File

@ -38,19 +38,19 @@ if (!($databaseUrl === false)) {
return [
'default' => env('DB_CONNECTION', 'mysql'),
'default' => envNonEmpty('DB_CONNECTION', 'mysql'),
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', storage_path('database/database.sqlite')),
'database' => envNonEmpty('DB_DATABASE', storage_path('database/database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'host' => envNonEmpty('DB_HOST', '127.0.0.1'),
'port' => envNonEmpty('DB_PORT', '3306'),
'database' => envNonEmpty('DB_DATABASE', 'forge'),
'username' => envNonEmpty('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
@ -61,10 +61,10 @@ return [
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', $host),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', $database),
'username' => env('DB_USERNAME', $username),
'host' => envNonEmpty('DB_HOST', $host),
'port' => envNonEmpty('DB_PORT', '5432'),
'database' => envNonEmpty('DB_DATABASE', $database),
'username' => envNonEmpty('DB_USERNAME', $username),
'password' => env('DB_PASSWORD', $password),
'charset' => 'utf8',
'prefix' => '',

View File

@ -34,7 +34,7 @@ return [
|
*/
'default' => env('LOG_CHANNEL', 'daily'),
'default' => envNonEmpty('LOG_CHANNEL', 'daily'),
/*
|--------------------------------------------------------------------------
@ -65,13 +65,13 @@ return [
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/ff3-' . PHP_SAPI . '.log'),
'level' => env('APP_LOG_LEVEL', 'info'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
'days' => 7,
],
'dailytest' => [
'driver' => 'daily',
'path' => storage_path('logs/test-ff3-' . PHP_SAPI . '.log'),
'level' => env('APP_LOG_LEVEL', 'info'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
'days' => 7,
],
@ -85,12 +85,12 @@ return [
'syslog' => [
'driver' => 'syslog',
'level' => env('APP_LOG_LEVEL', 'info'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('APP_LOG_LEVEL', 'info'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
],

View File

@ -38,7 +38,7 @@ return [
|
*/
'driver' => env('MAIL_DRIVER', 'log'),
'driver' => envNonEmpty('MAIL_DRIVER', 'log'),
/*
|--------------------------------------------------------------------------
@ -76,7 +76,7 @@ return [
| used globally for all e-mails that are sent by your application.
|
*/
'from' => ['address' => env('MAIL_FROM', 'changeme@example.com'), 'name' => 'Firefly III Mailer'],
'from' => ['address' => envNonEmpty('MAIL_FROM', 'changeme@example.com'), 'name' => 'Firefly III Mailer'],
/*

View File

@ -37,7 +37,7 @@ return [
|
*/
'default' => env('QUEUE_DRIVER', 'sync'),
'default' => envNonEmpty('QUEUE_DRIVER', 'sync'),
/*
|--------------------------------------------------------------------------
@ -100,7 +100,7 @@ return [
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'database' => envNonEmpty('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],