]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only check for apps owncloud version requirment when there is a new owncloud version
authorBart Visscher <bartv@thisnet.nl>
Sat, 16 Jun 2012 18:50:52 +0000 (20:50 +0200)
committerBart Visscher <bartv@thisnet.nl>
Sat, 16 Jun 2012 18:52:10 +0000 (20:52 +0200)
lib/app.php
lib/base.php

index 7fdfc93138f62c8fedf0207c80fba5853849d1e2..c08e977b0320634c933e2d4339ae3b64f896bad0 100755 (executable)
@@ -489,32 +489,33 @@ class OC_App{
                        $currentVersion=OC_App::getAppVersion($app);
                        if ($currentVersion) {
                                if (version_compare($currentVersion, $installedVersion, '>')) {
-                                       OC_Log::write($app,'starting app upgrade from '.$installedVersion.' to '.$currentVersion,OC_Log::DEBUG);
+                                       OC_Log::write($app, 'starting app upgrade from '.$installedVersion.' to '.$currentVersion,OC_Log::DEBUG);
                                        OC_App::updateApp($app);
-                                       OC_Appconfig::setValue($app,'installed_version',OC_App::getAppVersion($app));
+                                       OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app));
                                }
                        }
                }
+       }
 
-               // check if the current enabled apps are compatible with the current ownCloud version. disable them if not.
-               // this is important if you upgrade ownCloud and have non ported 3rd party apps installed
-               $apps =OC_App::getEnabledApps();
-               $version=OC_Util::getVersion();
+       /**
+        * check if the current enabled apps are compatible with the current
+        * ownCloud version. disable them if not.
+        * This is important if you upgrade ownCloud and have non ported 3rd
+        * party apps installed.
+        */
+       public static function checkAppsRequirements($apps = array()){
+               if (empty($apps)) {
+                       $apps = OC_App::getEnabledApps();
+               }
+               $version = OC_Util::getVersion();
                foreach($apps as $app) {
-
                        // check if the app is compatible with this version of ownCloud
-                       $info=OC_App::getAppInfo($app);
+                       $info = OC_App::getAppInfo($app);
                        if(!isset($info['require']) or ($version[0]>$info['require'])){
                                OC_Log::write('core','App "'.$info['name'].'" can\'t be used because it is not compatible with this version of ownCloud',OC_Log::ERROR);
                                OC_App::disable( $app );
                        }
-
-
-
                }
-
-
-
        }
 
        /**
index fedc1238851c10923e13797716ff0bfc49fd7516..30f7e5bba63e23a554bbe80dee0c3a1c17e9869a 100644 (file)
@@ -229,6 +229,7 @@ class OC{
                                }
 
                                OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
+                               OC_App::checkAppsRequirements();
                        }
 
                        OC_App::updateApps();