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

@@ -55,6 +55,9 @@ class Range
// set more view variables:
$this->configureList();
// flash a big fat warning when users use SQLite in Docker
$this->loseItAll($request);
}
return $next($request);
@@ -99,6 +102,18 @@ class Range
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.'
);
}
}
/**
*
*/