2020-05-07 04:13:06 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2020-08-24 08:54:25 -04:00
|
|
|
|
2020-05-07 04:13:06 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-05-07 04:13:06 -04:00
|
|
|
*/
|
|
|
|
|
namespace OC\AppFramework\Services;
|
|
|
|
|
|
|
|
|
|
use OCP\AppFramework\Services\IInitialState;
|
|
|
|
|
use OCP\IInitialStateService;
|
|
|
|
|
|
|
|
|
|
class InitialState implements IInitialState {
|
2025-11-17 09:32:54 -05:00
|
|
|
public function __construct(
|
|
|
|
|
private IInitialStateService $state,
|
|
|
|
|
private string $appName,
|
|
|
|
|
) {
|
2020-05-07 04:13:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideInitialState(string $key, $data): void {
|
|
|
|
|
$this->state->provideInitialState($this->appName, $key, $data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideLazyInitialState(string $key, \Closure $closure): void {
|
|
|
|
|
$this->state->provideLazyInitialState($this->appName, $key, $closure);
|
|
|
|
|
}
|
|
|
|
|
}
|