diff options
Diffstat (limited to 'lib/private/ocsclient.php')
-rw-r--r-- | lib/private/ocsclient.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index 2868b407000..9fa4aebb5e4 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -106,11 +106,12 @@ class OCSClient { /** * Get all the categories from the OCS server * + * @param array $targetVersion The target ownCloud version * @return array|null an array of category ids or null * @note returns NULL if config value appstoreenabled is set to false * This function returns a list of all the application categories on the OCS server */ - public function getCategories() { + public function getCategories($targetVersion) { if (!$this->isAppStoreEnabled()) { return null; } @@ -121,6 +122,9 @@ class OCSClient { $this->getAppStoreUrl() . '/content/categories', [ 'timeout' => 5, + 'query' => [ + 'version' => implode('x', $targetVersion), + ], ] ); } catch(\Exception $e) { @@ -155,9 +159,10 @@ class OCSClient { * @param array $categories * @param int $page * @param string $filter + * @param array $targetVersion The target ownCloud version * @return array An array of application data */ - public function getApplications(array $categories, $page, $filter) { + public function getApplications(array $categories, $page, $filter, $targetVersion) { if (!$this->isAppStoreEnabled()) { return []; } @@ -169,7 +174,7 @@ class OCSClient { [ 'timeout' => 5, 'query' => [ - 'version' => implode('x', \OC_Util::getVersion()), + 'version' => implode('x', $targetVersion), 'filter' => $filter, 'categories' => implode('x', $categories), 'sortmode' => 'new', @@ -229,11 +234,12 @@ class OCSClient { * Get an the applications from the OCS server * * @param string $id + * @param array $targetVersion The target ownCloud version * @return array|null an array of application data or null * * This function returns an applications from the OCS server */ - public function getApplication($id) { + public function getApplication($id, $targetVersion) { if (!$this->isAppStoreEnabled()) { return null; } @@ -244,6 +250,9 @@ class OCSClient { $this->getAppStoreUrl() . '/content/data/' . urlencode($id), [ 'timeout' => 5, + 'query' => [ + 'version' => implode('x', $targetVersion), + ], ] ); } catch(\Exception $e) { @@ -290,10 +299,11 @@ class OCSClient { /** * Get the download url for an application from the OCS server - * @param $id + * @param string $id + * @param array $targetVersion The target ownCloud version * @return array|null an array of application data or null */ - public function getApplicationDownload($id) { + public function getApplicationDownload($id, $targetVersion) { if (!$this->isAppStoreEnabled()) { return null; } @@ -304,6 +314,9 @@ class OCSClient { $url, [ 'timeout' => 5, + 'query' => [ + 'version' => implode('x', $targetVersion), + ], ] ); } catch(\Exception $e) { |