diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-03-07 20:57:05 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-03-07 20:57:05 +0100 |
commit | 57c4d39b1e0becaeeb795cfbfd70f525bd89b9d8 (patch) | |
tree | 5a12c8c7d83574b9bff3e4271e88ec740820c2aa /lib/installer.php | |
parent | 75323b86d157c48031b9ac8c151e4a41577a1481 (diff) | |
parent | cf5d63f0abc2b4537098962ad5051180861f965b (diff) | |
download | nextcloud-server-57c4d39b1e0becaeeb795cfbfd70f525bd89b9d8.tar.gz nextcloud-server-57c4d39b1e0becaeeb795cfbfd70f525bd89b9d8.zip |
Fix conflict.
Diffstat (limited to 'lib/installer.php')
-rw-r--r-- | lib/installer.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/installer.php b/lib/installer.php index b2f817e702f..2a9676998f6 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -62,7 +62,7 @@ class OC_Installer{ //download the file if necesary if($data['source']=='http'){ - $path=tempnam(get_temp_dir(),'oc_installer_'); + $path=OC_Helper::tmpFile('.zip'); if(!isset($data['href'])){ OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR); return false; @@ -103,7 +103,7 @@ class OC_Installer{ return false; } $info=OC_App::getAppInfo($extractDir.'/appinfo/info.xml'); - $basedir=OC::$SERVERROOT.'/apps/'.$info['id']; + $basedir=OC::$APPSROOT.'/apps/'.$info['id']; //check if an app with the same id is already installed if(self::isInstalled( $info['id'] )){ @@ -142,9 +142,6 @@ class OC_Installer{ //remove temporary files OC_Helper::rmdirr($extractDir); - if($data['source']=='http'){ - unlink($path); - } //install the database if(is_file($basedir.'/appinfo/database.xml')){ @@ -244,10 +241,10 @@ class OC_Installer{ * If $enabled is false, apps are installed as disabled. */ public static function installShippedApps(){ - $dir = opendir( OC::$SERVERROOT."/apps" ); + $dir = opendir( OC::$APPSROOT."/apps" ); while( false !== ( $filename = readdir( $dir ))){ - if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$SERVERROOT."/apps/$filename") ){ - if( file_exists( OC::$SERVERROOT."/apps/$filename/appinfo/app.php" )){ + if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$APPSROOT."/apps/$filename") ){ + if( file_exists( OC::$APPSROOT."/apps/$filename/appinfo/app.php" )){ if(!OC_Installer::isInstalled($filename)){ $info = OC_Installer::installShippedApp($filename); $enabled = isset($info['default_enable']); @@ -270,15 +267,15 @@ class OC_Installer{ */ public static function installShippedApp($app){ //install the database - if(is_file(OC::$SERVERROOT."/apps/$app/appinfo/database.xml")){ - OC_DB::createDbFromStructure(OC::$SERVERROOT."/apps/$app/appinfo/database.xml"); + if(is_file(OC::$APPSROOT."/apps/$app/appinfo/database.xml")){ + OC_DB::createDbFromStructure(OC::$APPSROOT."/apps/$app/appinfo/database.xml"); } //run appinfo/install.php - if(is_file(OC::$SERVERROOT."/apps/$app/appinfo/install.php")){ - include(OC::$SERVERROOT."/apps/$app/appinfo/install.php"); + if(is_file(OC::$APPSROOT."/apps/$app/appinfo/install.php")){ + include(OC::$APPSROOT."/apps/$app/appinfo/install.php"); } - $info=OC_App::getAppInfo(OC::$SERVERROOT."/apps/$app/appinfo/info.xml"); + $info=OC_App::getAppInfo(OC::$APPSROOT."/apps/$app/appinfo/info.xml"); OC_Appconfig::setValue($app,'installed_version',$info['version']); return $info; } |