diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-01-06 00:03:08 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-01-06 11:40:22 +0100 |
commit | 88c7face07722d03806c5b89a41a3ab90bbd9718 (patch) | |
tree | e95003decc4033538a188050b8a2cf7cf50db34c /lib/private/app.php | |
parent | c77917f48c6c6d7110c7380a398e25beb906f50f (diff) | |
download | nextcloud-server-88c7face07722d03806c5b89a41a3ab90bbd9718.tar.gz nextcloud-server-88c7face07722d03806c5b89a41a3ab90bbd9718.zip |
Inject OCSClient
Fixes https://github.com/owncloud/core/issues/21451
Diffstat (limited to 'lib/private/app.php')
-rw-r--r-- | lib/private/app.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 5f6ca9596c8..500a60060e6 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -760,9 +760,12 @@ class OC_App { * @param bool $onlyLocal * @param bool $includeUpdateInfo Should we check whether there is an update * in the app store? + * @param OCSClient $ocsClient * @return array */ - public static function listAllApps($onlyLocal = false, $includeUpdateInfo = true) { + public static function listAllApps($onlyLocal = false, + $includeUpdateInfo = true, + OCSClient $ocsClient) { $installedApps = OC_App::getAllApps(); //TODO which apps do we want to blacklist and how do we integrate @@ -825,7 +828,7 @@ class OC_App { if ($onlyLocal) { $remoteApps = []; } else { - $remoteApps = OC_App::getAppstoreApps(); + $remoteApps = OC_App::getAppstoreApps('approved', null, $ocsClient); } if ($remoteApps) { // Remove duplicates @@ -865,20 +868,16 @@ class OC_App { /** * Get a list of all apps on the appstore * @param string $filter - * @param string $category + * @param string|null $category + * @param OCSClient $ocsClient * @return array|bool multi-dimensional array of apps. * Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description */ - public static function getAppstoreApps($filter = 'approved', $category = null) { + public static function getAppstoreApps($filter = 'approved', + $category = null, + OCSClient $ocsClient) { $categories = [$category]; - $ocsClient = new OCSClient( - \OC::$server->getHTTPClientService(), - \OC::$server->getConfig(), - \OC::$server->getLogger() - ); - - if (is_null($category)) { $categoryNames = $ocsClient->getCategories(\OCP\Util::getVersion()); if (is_array($categoryNames)) { |