aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@oc.(none)>2013-01-30 12:08:14 +0100
committerroot <root@oc.(none)>2013-01-30 12:08:14 +0100
commit3fa4b3abff5040a46720b2d11531d36a65e4836e (patch)
tree734f52b8a0c40f24827c6cce3d5faed85e5bc89f
parenta27f92a17ae12d2d1ff48b26aadfecd7c221c589 (diff)
downloadnextcloud-server-3fa4b3abff5040a46720b2d11531d36a65e4836e.tar.gz
nextcloud-server-3fa4b3abff5040a46720b2d11531d36a65e4836e.zip
apps updater is now working
-rw-r--r--lib/app.php4
-rw-r--r--lib/installer.php28
2 files changed, 10 insertions, 22 deletions
diff --git a/lib/app.php b/lib/app.php
index 13f54d6cf75..52df04e73b8 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -179,7 +179,7 @@ class OC_App{
* This function checks whether or not an app is enabled.
*/
public static function isEnabled( $app ) {
- if( 'files'==$app or 'yes' == OC_Appconfig::getValue( $app, 'enabled' )) {
+ if( 'files'==$app or ('yes' == OC_Appconfig::getValue( $app, 'enabled' ))) {
return true;
}
@@ -236,10 +236,8 @@ class OC_App{
// check if app is a shiped app or not. if not delete
if(!OC_App::isShipped( $app )){
-// error_log($app.' not shipped');
OC_Installer::removeApp( $app );
}else{
-// error_log($app.' shipped');
}
}
diff --git a/lib/installer.php b/lib/installer.php
index f4094a5d4c9..8cffe5f06c7 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -155,16 +155,6 @@ class OC_Installer{
return false;
}
- //check if an app with the same id is already installed
- if(self::isInstalled( $info['id'] )) {
- OC_Log::write('core', 'App already installed', OC_Log::WARN);
- OC_Helper::rmdirr($extractDir);
- if($data['source']=='http') {
- unlink($path);
- }
- return false;
- }
-
$basedir=OC_App::getInstallPath().'/'.$info['id'];
//check if the destination directory already exists
if(is_dir($basedir)) {
@@ -264,10 +254,9 @@ class OC_Installer{
* upgrade.php can determine the current installed version of the app using "OC_Appconfig::getValue($appid, 'installed_version')"
*/
public static function updateApp( $app ) {
- error_log('updater!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
- return(true);
- if(OC_Installer::isDownloaded( $name )) {
- }
+ $ocsid=OC_Appconfig::getValue( $app, 'ocsid', '');
+ OC_App::disable($app);
+ OC_App::enable($ocsid);
}
/**
@@ -278,19 +267,20 @@ class OC_Installer{
* The function will check if an update for a version is available
*/
public static function isUpdateAvailable( $app ) {
- //debug
- return('1.1');
$ocsid=OC_Appconfig::getValue( $app, 'ocsid', '');
if($ocsid<>''){
$ocsdata=OC_OCSClient::getApplication($ocsid);
- $ocsversion=$ocsdata['version'];
+ $ocsversion= (string) $ocsdata['version'];
$currentversion=OC_App::getAppVersion($app);
+ if($ocsversion<>$currentversion){
+ return($ocsversion);
-//error_log('bb'.$app.' '.$ocsversion);
- return($ocsversion);
+ }else{
+ return('');
+ }
}else{
return('');