Code for @1346

This commit is contained in:
James Cole
2018-04-21 20:36:42 +02:00
parent 769b4819b2
commit 592901b143
2 changed files with 16 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ LOG_CHANNEL=${LOG_CHANNEL}
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III # Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings. # If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
DB_CONNECTION=mysql DB_CONNECTION=${FF_DB_CONNECTION}
DB_HOST=${FF_DB_HOST} DB_HOST=${FF_DB_HOST}
DB_PORT=${FF_DB_PORT} DB_PORT=${FF_DB_PORT}
DB_DATABASE=${FF_DB_NAME} DB_DATABASE=${FF_DB_NAME}

View File

@@ -55,6 +55,9 @@ class Range
// set more view variables: // set more view variables:
$this->configureList(); $this->configureList();
// flash a big fat warning when users use SQLite in Docker
$this->loseItAll($request);
} }
return $next($request); return $next($request);
@@ -99,6 +102,18 @@ class Range
View::share('defaultCurrency', $defaultCurrency); View::share('defaultCurrency', $defaultCurrency);
} }
/**
* @param Request $request
*/
private function loseItAll(Request $request)
{
if (getenv('DB_CONNECTION') === 'sqlite' && getenv('IS_DOCKER') === true) {
$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.'
);
}
}
/** /**
* *
*/ */