Learned that I should not refer to env vars directly so I removed all references.

This commit is contained in:
James Cole
2018-12-15 07:59:02 +01:00
parent 4bd94e5450
commit c54541b839
116 changed files with 239 additions and 157 deletions

View File

@@ -54,7 +54,7 @@ class Installer
*/
public function handle($request, Closure $next)
{
if ('testing' === env('APP_ENV')) {
if ('testing' === config('app.env')) {
return $next($request);
}
$url = $request->url();

View File

@@ -107,7 +107,7 @@ class Range
*/
private function loseItAll(Request $request): void
{
if ('sqlite' === getenv('DB_CONNECTION') && true === getenv('IS_DOCKER')) {
if ('sqlite' === config('database.default') && true === config('firefly.is_docker')) {
// @codeCoverageIgnoreStart
$request->session()->flash(
'error', 'You seem to be using SQLite in a Docker container. Don\'t do this. If the container restarts all your data will be gone.'

View File

@@ -44,7 +44,7 @@ class SecureHeaders
{
$response = $next($request);
$google = '';
$analyticsId = env('ANALYTICS_ID', '');
$analyticsId = config('firefly.analytics_id');
if ('' !== $analyticsId) {
$google = 'www.googletagmanager.com/gtag/js'; // @codeCoverageIgnore
}
@@ -76,7 +76,7 @@ class SecureHeaders
"payment 'none'",
];
$disableFrameHeader = env('DISABLE_FRAME_HEADER');
$disableFrameHeader = config('firefly.disable_frame_header');
if (false === $disableFrameHeader || null === $disableFrameHeader) {
$response->header('X-Frame-Options', 'deny');
}

View File

@@ -43,7 +43,7 @@ class TrustProxies extends Middleware
*/
public function __construct(Repository $config)
{
$trustedProxies = (string)env('TRUSTED_PROXIES', null);
$trustedProxies = (string)config('firefly.trusted_proxies');
$this->proxies = explode(',', $trustedProxies);
if ('**' === $trustedProxies) {
$this->proxies = '**';