diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-03-29 00:11:29 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-03-29 00:11:29 +0200 |
commit | 60ba5508a4bfaf0581301a6240011060a7432997 (patch) | |
tree | 2c182aa55d54d874941bd3d33c130ae6f94a35e6 /lib | |
parent | d6a9af31389819c95084e33aab3c7f4a6d4cbef8 (diff) | |
download | nextcloud-server-60ba5508a4bfaf0581301a6240011060a7432997.tar.gz nextcloud-server-60ba5508a4bfaf0581301a6240011060a7432997.zip |
add support for installing apps from a subfolder in the zip/tgz file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/installer.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/installer.php b/lib/installer.php index db64d8e32d5..c5ecacae544 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -105,6 +105,17 @@ class OC_Installer{ //load the info.xml file of the app if(!is_file($extractDir.'/appinfo/info.xml')){ + //try to find it in a subdir + $dh=opendir($extractDir); + while($folder=readdir($dh)){ + if(substr($folder,0,1)!='.' and is_dir($extractDir.'/'.$folder)){ + if(is_file($extractDir.'/'.$folder.'/appinfo/info.xml')){ + $extractDir.='/'.$folder; + } + } + } + } + if(!is_file($extractDir.'/appinfo/info.xml')){ OC_Log::write('core','App does not provide an info.xml file',OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ |