diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2024-03-13 01:21:40 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2024-03-13 02:22:11 -0100 |
commit | 519e4345739876d2ae7e064e347d19524905b090 (patch) | |
tree | 0b997f8d18f54efcb97e9278503ae42e119fd9b6 /apps/settings/lib/Settings | |
parent | 5723c13dc0c7f4025c4d976c1f792f9bb3513fe2 (diff) | |
download | nextcloud-server-519e4345739876d2ae7e064e347d19524905b090.tar.gz nextcloud-server-519e4345739876d2ae7e064e347d19524905b090.zip |
fix(updatenotification): spread the use of new appconfig
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps/settings/lib/Settings')
-rw-r--r-- | apps/settings/lib/Settings/Admin/Server.php | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/apps/settings/lib/Settings/Admin/Server.php b/apps/settings/lib/Settings/Admin/Server.php index 9aa8b1ed56d..d6d36432b42 100644 --- a/apps/settings/lib/Settings/Admin/Server.php +++ b/apps/settings/lib/Settings/Admin/Server.php @@ -30,6 +30,7 @@ use OC\Profile\TProfileHelper; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\IAppConfig; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; @@ -39,28 +40,16 @@ use OCP\Settings\IDelegatedSettings; class Server implements IDelegatedSettings { use TProfileHelper; - private IDBConnection $connection; - private IInitialState $initialStateService; - private ProfileManager $profileManager; - private ITimeFactory $timeFactory; - private IConfig $config; - private IL10N $l; - private IURLGenerator $urlGenerator; - - public function __construct(IDBConnection $connection, - IInitialState $initialStateService, - ProfileManager $profileManager, - ITimeFactory $timeFactory, - IURLGenerator $urlGenerator, - IConfig $config, - IL10N $l) { - $this->connection = $connection; - $this->initialStateService = $initialStateService; - $this->profileManager = $profileManager; - $this->timeFactory = $timeFactory; - $this->config = $config; - $this->l = $l; - $this->urlGenerator = $urlGenerator; + public function __construct( + private IDBConnection $connection, + private IInitialState $initialStateService, + private ProfileManager $profileManager, + private ITimeFactory $timeFactory, + private IURLGenerator $urlGenerator, + private IConfig $config, + private IAppConfig $appConfig, + private IL10N $l, + ) { } /** @@ -69,7 +58,7 @@ class Server implements IDelegatedSettings { public function getForm() { // Background jobs $this->initialStateService->provideInitialState('backgroundJobsMode', $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax')); - $this->initialStateService->provideInitialState('lastCron', (int)$this->config->getAppValue('core', 'lastcron', '0')); + $this->initialStateService->provideInitialState('lastCron', $this->appConfig->getValueInt('core', 'lastcron', 0)); $this->initialStateService->provideInitialState('cronMaxAge', $this->cronMaxAge()); $this->initialStateService->provideInitialState('cronErrors', $this->config->getAppValue('core', 'cronErrors')); $this->initialStateService->provideInitialState('cliBasedCronPossible', function_exists('posix_getpwuid')); |