aboutsummaryrefslogtreecommitdiffstats
path: root/lib/app.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-05-28 17:33:25 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-05-28 17:33:25 +0200
commitf4e4617be7a22a0191bf1bc21f6d8462d215108e (patch)
tree54c36cb8e3081ec83a3a8b4e36d443966ab35e8e /lib/app.php
parentd23ecd0538b8d86941e1ff5e2d6908fb5df2a524 (diff)
downloadnextcloud-server-f4e4617be7a22a0191bf1bc21f6d8462d215108e.tar.gz
nextcloud-server-f4e4617be7a22a0191bf1bc21f6d8462d215108e.zip
App installer backend.
Not yet attached to the gui
Diffstat (limited to 'lib/app.php')
-rw-r--r--lib/app.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/app.php b/lib/app.php
index 83c80f6356e..cec7468c8e7 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -317,20 +317,23 @@ class OC_APP{
/**
* @brief Read app metadata from the info.xml file
- * @param string $appid id of the app
+ * @param string $appid id of the app or the path of the info.xml file
* @returns array
*/
public static function getAppInfo($appid){
- $file='apps/'.$appid.'/appinfo/info.xml';
- if(!is_file($file)){
- return array();
+ if(is_file($appid)){
+ $file=$appid;
+ }else{
+ $file='apps/'.$appid.'/appinfo/info.xml';
+ if(!is_file($file)){
+ return array();
+ }
}
$data=array();
$content=file_get_contents($file);
$xml = new SimpleXMLElement($content);
- $info=$xml->info[0];
$data['info']=array();
- foreach($info->children() as $child){
+ foreach($xml->children() as $child){
$data[$child->getName()]=(string)$child;
}
return $data;