diff options
author | Frank Karlitschek <karlitschek@kde.org> | 2012-01-06 19:08:35 +0100 |
---|---|---|
committer | Frank Karlitschek <karlitschek@kde.org> | 2012-01-06 19:08:35 +0100 |
commit | d485a70e7df602e85506ad94103df00f8bb3f765 (patch) | |
tree | bc8280f82e08b792d885416ab8e9725d69adf276 /lib/ocsclient.php | |
parent | f9db4249a3a7b73f6c712cfa32b029e6d09595f5 (diff) | |
download | nextcloud-server-d485a70e7df602e85506ad94103df00f8bb3f765.tar.gz nextcloud-server-d485a70e7df602e85506ad94103df00f8bb3f765.zip |
finish the application store feature so that users can download and install ownCloud apps from our website. there is still a small problem with write permissions. will look into this later
Diffstat (limited to 'lib/ocsclient.php')
-rw-r--r-- | lib/ocsclient.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 072fd236fee..9d5932fb720 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -130,6 +130,33 @@ class OC_OCSClient{ return $app; } + /** + * @brief Get the download url for an application from the OCS server + * @returns array with application data + * + * This function returns an download url for an applications from the OCS server + */ + public static function getApplicationDownload($id,$item){ + $url='http://api.apps.owncloud.com/v1/content/download/'.urlencode($id).'/'.urlencode($item); + + $xml=@file_get_contents($url); + if($xml==FALSE){ + OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL); + return NULL; + } + $data=simplexml_load_string($xml); + + $tmp=$data->data->content; + $app=array(); + if(isset($tmp->downloadlink)) { + $app['downloadlink']=$tmp->downloadlink; + }else{ + $app['downloadlink']=''; + } + return $app; + } + + /** * @brief Get all the knowledgebase entries from the OCS server * @returns array with q and a data |