mirror of
https://github.com/nextcloud/app_api.git
synced 2026-01-13 20:19:21 +00:00
We hold pre-defined API Scopes in memory only. Anyway we currently do not supporting defining API Scopes at runtime and not sure that we will in future, so better to make it simpler and faster for now. --------- Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
32 lines
778 B
PHP
32 lines
778 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\AppAPI\Migration;
|
|
|
|
use OCA\AppAPI\DeployActions\AIODockerActions;
|
|
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\IRepairStep;
|
|
|
|
class DataInitializationStep implements IRepairStep {
|
|
public function __construct(
|
|
private readonly AIODockerActions $AIODockerActions,
|
|
) {
|
|
}
|
|
|
|
public function getName(): string {
|
|
return 'Initializing data for AppAPI';
|
|
}
|
|
|
|
public function run(IOutput $output): void {
|
|
// If in AIO - automatically register default DaemonConfig
|
|
if ($this->AIODockerActions->isAIO()) {
|
|
$output->info('AIO installation detected. Registering default daemon');
|
|
if ($this->AIODockerActions->registerAIODaemonConfig() !== null) {
|
|
$output->info('AIO DaemonConfig successfully registered');
|
|
}
|
|
}
|
|
}
|
|
}
|