diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-09 17:49:03 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-19 11:44:02 +0200 |
commit | efa2dfa64131e25644c045658ea226b110782fa4 (patch) | |
tree | 4e90566ef2b024aa242ebb64b430e4b5d98cacdf | |
parent | bd370678210b69eedf4c579033ca2b60b897bd13 (diff) | |
download | nextcloud-server-efa2dfa64131e25644c045658ea226b110782fa4.tar.gz nextcloud-server-efa2dfa64131e25644c045658ea226b110782fa4.zip |
Add OCP interface for SetupCheckManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 5 | ||||
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/private/Server.php | 4 | ||||
-rw-r--r-- | lib/private/SetupCheck/SetupCheckManager.php | 3 | ||||
-rw-r--r-- | lib/public/SetupCheck/ISetupCheckManager.php | 37 |
6 files changed, 48 insertions, 3 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 9f2ba0e5bf6..b2da455bc11 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -85,6 +85,7 @@ use OCP\Lock\ILockingProvider; use OCP\Notification\IManager; use OCP\Security\Bruteforce\IThrottler; use OCP\Security\ISecureRandom; +use OCP\SetupCheck\ISetupCheckManager; use Psr\Log\LoggerInterface; #[IgnoreOpenAPI] @@ -127,7 +128,7 @@ class CheckSetupController extends Controller { private $appManager; /** @var IServerContainer */ private $serverContainer; - private OC\SetupCheck\SetupCheckManager $setupCheckManager; + private ISetupCheckManager $setupCheckManager; public function __construct($AppName, IRequest $request, @@ -150,7 +151,7 @@ class CheckSetupController extends Controller { IManager $manager, IAppManager $appManager, IServerContainer $serverContainer, - OC\SetupCheck\SetupCheckManager $setupCheckManager + ISetupCheckManager $setupCheckManager, ) { parent::__construct($AppName, $request); $this->config = $config; diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index b656f83e747..9d0570d349c 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -602,6 +602,7 @@ return array( 'OCP\\Settings\\ISettings' => $baseDir . '/lib/public/Settings/ISettings.php', 'OCP\\Settings\\ISubAdminSettings' => $baseDir . '/lib/public/Settings/ISubAdminSettings.php', 'OCP\\SetupCheck\\ISetupCheck' => $baseDir . '/lib/public/SetupCheck/ISetupCheck.php', + 'OCP\\SetupCheck\\ISetupCheckManager' => $baseDir . '/lib/public/SetupCheck/ISetupCheckManager.php', 'OCP\\SetupCheck\\SetupResult' => $baseDir . '/lib/public/SetupCheck/SetupResult.php', 'OCP\\Share' => $baseDir . '/lib/public/Share.php', 'OCP\\Share\\Events\\BeforeShareCreatedEvent' => $baseDir . '/lib/public/Share/Events/BeforeShareCreatedEvent.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 70f47a58976..63ad21216a4 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -635,6 +635,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Settings\\ISettings' => __DIR__ . '/../../..' . '/lib/public/Settings/ISettings.php', 'OCP\\Settings\\ISubAdminSettings' => __DIR__ . '/../../..' . '/lib/public/Settings/ISubAdminSettings.php', 'OCP\\SetupCheck\\ISetupCheck' => __DIR__ . '/../../..' . '/lib/public/SetupCheck/ISetupCheck.php', + 'OCP\\SetupCheck\\ISetupCheckManager' => __DIR__ . '/../../..' . '/lib/public/SetupCheck/ISetupCheckManager.php', 'OCP\\SetupCheck\\SetupResult' => __DIR__ . '/../../..' . '/lib/public/SetupCheck/SetupResult.php', 'OCP\\Share' => __DIR__ . '/../../..' . '/lib/public/Share.php', 'OCP\\Share\\Events\\BeforeShareCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/BeforeShareCreatedEvent.php', diff --git a/lib/private/Server.php b/lib/private/Server.php index 949a7ccfd3f..b8004670634 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -149,6 +149,7 @@ use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Security\VerificationToken\VerificationToken; use OC\Session\CryptoWrapper; +use OC\SetupCheck\SetupCheckManager; use OC\Share20\ProviderFactory; use OC\Share20\ShareDisableChecker; use OC\Share20\ShareHelper; @@ -247,6 +248,7 @@ use OCP\Security\ISecureRandom; use OCP\Security\ITrustedDomainHelper; use OCP\Security\RateLimiting\ILimiter; use OCP\Security\VerificationToken\IVerificationToken; +use OCP\SetupCheck\ISetupCheckManager; use OCP\Share\IShareHelper; use OCP\SpeechToText\ISpeechToTextManager; use OCP\SystemTag\ISystemTagManager; @@ -1430,6 +1432,8 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias(IOCMProvider::class, OCMProvider::class); + $this->registerAlias(ISetupCheckManager::class, SetupCheckManager::class); + $this->connectDispatcher(); } diff --git a/lib/private/SetupCheck/SetupCheckManager.php b/lib/private/SetupCheck/SetupCheckManager.php index d1a9b4c4c31..1a7b5d555b9 100644 --- a/lib/private/SetupCheck/SetupCheckManager.php +++ b/lib/private/SetupCheck/SetupCheckManager.php @@ -29,8 +29,9 @@ namespace OC\SetupCheck; use OC\AppFramework\Bootstrap\Coordinator; use OCP\Server; use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\ISetupCheckManager; -class SetupCheckManager { +class SetupCheckManager implements ISetupCheckManager { private Coordinator $coordinator; public function __construct(Coordinator $coordinator) { diff --git a/lib/public/SetupCheck/ISetupCheckManager.php b/lib/public/SetupCheck/ISetupCheckManager.php new file mode 100644 index 00000000000..4b963e7c6b8 --- /dev/null +++ b/lib/public/SetupCheck/ISetupCheckManager.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\SetupCheck; + +/** + * @since 28.0.0 + */ +interface ISetupCheckManager { + /** + * @since 28.0.0 + * @return array<string,array<string,SetupResult>> Result of each check, first level key is category, second level key is title + */ + public function runAll(): array; +} |