diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-07 00:16:10 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-07 00:16:10 +0100 |
commit | e8d08d4930fae31a665c679b5ac1a147859eb099 (patch) | |
tree | 426671882f753d0fea8f80c786bdd6892d57cdb5 /lib/app.php | |
parent | 1137723b2a46c37d61e7f501694c73562b21ef74 (diff) | |
parent | 0b007235b99fa8d66cdb8ca917fe2f45dd8e4edc (diff) | |
download | nextcloud-server-e8d08d4930fae31a665c679b5ac1a147859eb099.tar.gz nextcloud-server-e8d08d4930fae31a665c679b5ac1a147859eb099.zip |
merge master into filesystem
Diffstat (limited to 'lib/app.php')
-rw-r--r--[-rwxr-xr-x] | lib/app.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/app.php b/lib/app.php index 0460a15502a..2926b794857 100755..100644 --- a/lib/app.php +++ b/lib/app.php @@ -137,6 +137,20 @@ class OC_App{ OC_Appconfig::setValue($app, 'types', $appTypes); } + + /** + * check if app is shipped + * @param string $appid the id of the app to check + * @return bool + */ + public static function isShipped($appid){ + $info = self::getAppInfo($appid); + if(isset($info['shipped']) && $info['shipped']=='true'){ + return true; + } else { + return false; + } + } /** * get all enabled apps @@ -634,12 +648,15 @@ class OC_App{ if ($currentVersion) { $installedVersion = $versions[$app]; if (version_compare($currentVersion, $installedVersion, '>')) { + $info = self::getAppInfo($app); OC_Log::write($app, 'starting app upgrade from '.$installedVersion.' to '.$currentVersion, OC_Log::DEBUG); try { OC_App::updateApp($app); + OC_Hook::emit('update', 'success', 'Updated '.$info['name'].' app'); } catch (Exception $e) { echo 'Failed to upgrade "'.$app.'". Exception="'.$e->getMessage().'"'; + OC_Hook::emit('update', 'failure', 'Failed to update '.$info['name'].' app: '.$e->getMessage()); die; } OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app)); @@ -664,6 +681,7 @@ class OC_App{ if(!isset($info['require']) or (($version[0].'.'.$version[1])>$info['require'])) { OC_Log::write('core', 'App "'.$info['name'].'" ('.$app.') can\'t be used because it is not compatible with this version of ownCloud', OC_Log::ERROR); OC_App::disable( $app ); + OC_Hook::emit('update', 'success', 'Disabled '.$info['name'].' app because it is not compatible'); } } } |