|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/** |
| 6 | + * @copyright Copyright (c) 2022-2023 Andrey Borysenko <andrey18106x@gmail.com> |
| 7 | + * |
| 8 | + * @copyright Copyright (c) 2022-2023 Alexander Piskun <bigcat88@icloud.com> |
| 9 | + * |
| 10 | + * @author 2022-2023 Andrey Borysenko <andrey18106x@gmail.com> |
| 11 | + * |
| 12 | + * @license AGPL-3.0-or-later |
| 13 | + * |
| 14 | + * This program is free software: you can redistribute it and/or modify |
| 15 | + * it under the terms of the GNU Affero General Public License as |
| 16 | + * published by the Free Software Foundation, either version 3 of the |
| 17 | + * License, or (at your option) any later version. |
| 18 | + * |
| 19 | + * This program is distributed in the hope that it will be useful, |
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | + * GNU Affero General Public License for more details. |
| 23 | + * |
| 24 | + * You should have received a copy of the GNU Affero General Public License |
| 25 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 26 | + * |
| 27 | + */ |
| 28 | + |
| 29 | +namespace OCA\Cloud_Py_API\Migration; |
| 30 | + |
| 31 | +use OCP\Migration\IOutput; |
| 32 | +use OCP\Migration\IRepairStep; |
| 33 | + |
| 34 | +use OCA\Cloud_Py_API\Migration\data\AppInitialData; |
| 35 | +use OCA\Cloud_Py_API\Service\UtilsService; |
| 36 | + |
| 37 | +class AppUpdateStep implements IRepairStep { |
| 38 | + /** @var UtilsService */ |
| 39 | + private $utils; |
| 40 | + |
| 41 | + public function __construct(UtilsService $utils) { |
| 42 | + $this->utils = $utils; |
| 43 | + } |
| 44 | + |
| 45 | + public function getName(): string { |
| 46 | + return "Updating Cloud_Py_API data"; |
| 47 | + } |
| 48 | + |
| 49 | + public function run(IOutput $output) { |
| 50 | + $output->startProgress(1); |
| 51 | + $app_data = AppInitialData::$INITIAL_DATA; |
| 52 | + |
| 53 | + $output->advance(1, 'Checking for inital data changes and syncing with database'); |
| 54 | + $this->utils->checkForSettingsUpdates($app_data); |
| 55 | + |
| 56 | + $output->finishProgress(); |
| 57 | + } |
| 58 | +} |
0 commit comments