Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@oc.(none)>2013-01-30 15:08:14 +0400
committerroot <root@oc.(none)>2013-01-30 15:08:14 +0400
commit3fa4b3abff5040a46720b2d11531d36a65e4836e (patch)
tree734f52b8a0c40f24827c6cce3d5faed85e5bc89f /lib/installer.php
parenta27f92a17ae12d2d1ff48b26aadfecd7c221c589 (diff)
apps updater is now working
Diffstat (limited to 'lib/installer.php')
-rw-r--r--lib/installer.php28
1 files changed, 9 insertions, 19 deletions
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('');