summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-17 15:29:15 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-02-17 16:05:23 +0100
commit2e15c0d871860df4b9be55a7c67e29f76aeb8a7c (patch)
tree06baa0cbb8cdee155e7e43d6ea6826b572b6c18e /lib/private/legacy/app.php
parent9dc3b0480228a3c35b3b7a7cb1a904006f7e0762 (diff)
downloadnextcloud-server-2e15c0d871860df4b9be55a7c67e29f76aeb8a7c.tar.gz
nextcloud-server-2e15c0d871860df4b9be55a7c67e29f76aeb8a7c.zip
Refactor dependencies in setAppTypes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 40af10f36fc..6ce18bc7911 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -303,8 +303,9 @@ class OC_App {
/**
* read app types from info.xml and cache them in the database
*/
- public static function setAppTypes($app) {
- $appData = self::getAppInfo($app);
+ public static function setAppTypes(string $app) {
+ $appManager = \OC::$server->getAppManager();
+ $appData = $appManager->getAppInfo($app);
if(!is_array($appData)) {
return;
}
@@ -316,12 +317,13 @@ class OC_App {
$appData['types'] = [];
}
- \OC::$server->getConfig()->setAppValue($app, 'types', $appTypes);
+ $config = \OC::$server->getConfig();
+ $config->setAppValue($app, 'types', $appTypes);
- if (\OC::$server->getAppManager()->hasProtectedAppType($appData['types'])) {
- $enabled = \OC::$server->getConfig()->getAppValue($app, 'enabled', 'yes');
+ if ($appManager->hasProtectedAppType($appData['types'])) {
+ $enabled = $config->getAppValue($app, 'enabled', 'yes');
if ($enabled !== 'yes' && $enabled !== 'no') {
- \OC::$server->getConfig()->setAppValue($app, 'enabled', 'yes');
+ $config->setAppValue($app, 'enabled', 'yes');
}
}
}