Skip to content

Commit 9304ae2

Browse files
committed
Refactor OC\Server::getAppConfig
1 parent 613cd16 commit 9304ae2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

core/register_command.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
* along with this program. If not, see <http://www.gnu.org/licenses/>
4949
*
5050
*/
51+
52+
use OCP\IAppConfig;
5153
use Psr\Log\LoggerInterface;
5254

5355
$application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
@@ -98,7 +100,7 @@
98100
$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
99101
$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
100102
$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
101-
$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
103+
$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->get(IAppConfig::class)));
102104
$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
103105
$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
104106
$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));

lib/private/legacy/OC_App.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
use OCP\App\ManagerEvent;
5757
use OCP\Authentication\IAlternativeLogin;
5858
use OCP\EventDispatcher\IEventDispatcher;
59+
use OCP\IAppConfig;
5960
use OCP\ILogger;
6061
use OC\AppFramework\Bootstrap\Coordinator;
6162
use OC\App\DependencyAnalyzer;
@@ -731,7 +732,7 @@ public static function getAppVersions() {
731732
static $versions;
732733

733734
if (!$versions) {
734-
$appConfig = \OC::$server->getAppConfig();
735+
$appConfig = \OC::$server->get(IAppConfig::class);
735736
$versions = $appConfig->getValues(false, 'installed_version');
736737
}
737738
return $versions;

0 commit comments

Comments
 (0)