mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-17 10:13:37 +00:00
Force fresh config var [skip ci]
This commit is contained in:
@@ -54,7 +54,7 @@ class Installer
|
||||
|
||||
// older version in config than database?
|
||||
$configVersion = intval(config('firefly.db_version'));
|
||||
$dbVersion = intval(FireflyConfig::get('db_version', 1)->data);
|
||||
$dbVersion = intval(FireflyConfig::getFresh('db_version', 1)->data);
|
||||
if ($configVersion > $dbVersion) {
|
||||
Log::warning(sprintf(
|
||||
'The current installed version (%d) is older than the required version (%d). Redirect to migrate routine.', $dbVersion, $configVersion
|
||||
|
@@ -77,6 +77,27 @@ class FireflyConfig
|
||||
return $this->set($name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param null $default
|
||||
*
|
||||
* @return \FireflyIII\Models\Configuration|null
|
||||
*/
|
||||
public function getFresh($name, $default = null)
|
||||
{
|
||||
$config = Configuration::where('name', $name)->first(['id', 'name', 'data']);
|
||||
if ($config) {
|
||||
|
||||
return $config;
|
||||
}
|
||||
// no preference found and default is null:
|
||||
if (null === $default) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->set($name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $value
|
||||
|
Reference in New Issue
Block a user