Replace config calls.

This commit is contained in:
James Cole
2025-12-20 06:42:11 +01:00
parent b0cc5f3a46
commit 0f0cdb8e96
42 changed files with 90 additions and 89 deletions

View File

@@ -54,7 +54,7 @@ class VersionCheckEventHandler
Log::debug('Now in checkForUpdates()');
// should not check for updates:
$permission = app('fireflyconfig')->get('permission_update_check', -1);
$permission = \FireflyIII\Support\Facades\FireflyConfig::get('permission_update_check', -1);
$value = (int) $permission->data;
if (1 !== $value) {
Log::debug('Update check is not enabled.');
@@ -73,7 +73,7 @@ class VersionCheckEventHandler
}
/** @var Configuration $lastCheckTime */
$lastCheckTime = app('fireflyconfig')->get('last_update_check', Carbon::now()->getTimestamp());
$lastCheckTime = \FireflyIII\Support\Facades\FireflyConfig::get('last_update_check', Carbon::now()->getTimestamp());
$now = Carbon::now()->getTimestamp();
$diff = $now - $lastCheckTime->data;
Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
@@ -87,7 +87,7 @@ class VersionCheckEventHandler
$release = $this->getLatestRelease();
session()->flash($release['level'], $release['message']);
app('fireflyconfig')->set('last_update_check', Carbon::now()->getTimestamp());
\FireflyIII\Support\Facades\FireflyConfig::set('last_update_check', Carbon::now()->getTimestamp());
}
/**
@@ -107,7 +107,7 @@ class VersionCheckEventHandler
}
/** @var Configuration $lastCheckTime */
$lastCheckTime = app('fireflyconfig')->get('last_update_warning', Carbon::now()->getTimestamp());
$lastCheckTime = \FireflyIII\Support\Facades\FireflyConfig::get('last_update_warning', Carbon::now()->getTimestamp());
$now = Carbon::now()->getTimestamp();
$diff = $now - $lastCheckTime->data;
Log::debug(sprintf('Last warning time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
@@ -120,6 +120,6 @@ class VersionCheckEventHandler
Log::debug('Have warned about a new version in four weeks!');
session()->flash('info', (string) trans('firefly.disabled_but_check'));
app('fireflyconfig')->set('last_update_warning', Carbon::now()->getTimestamp());
\FireflyIII\Support\Facades\FireflyConfig::set('last_update_warning', Carbon::now()->getTimestamp());
}
}