diff options
author | kondou <kondou@ts.unde.re> | 2013-08-06 17:19:18 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-06 17:19:18 +0200 |
commit | 1a4465f41d3fe334f42782545e3130a19796e590 (patch) | |
tree | b3e5fbd743dd22ea3255e96593735791a59b11a1 /lib/app.php | |
parent | 057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff) | |
download | nextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.tar.gz nextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.zip |
Improve app-management
- Better error messages
- Translate untranslated strings
Basically picks non-app-dependency related stuff from #4017
Diffstat (limited to 'lib/app.php')
-rw-r--r-- | lib/app.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/app.php b/lib/app.php index 2437896157a..1ff18c799cb 100644 --- a/lib/app.php +++ b/lib/app.php @@ -210,7 +210,8 @@ class OC_App{ /** * @brief enables an app * @param mixed $app app - * @return bool + * @throws \Exception + * @return void * * This function set an app as enabled in appconfig. */ @@ -228,6 +229,7 @@ class OC_App{ } } } + $l = OC_L10N::get('core'); if($app!==false) { // check if the app is compatible with this version of ownCloud $info=OC_App::getAppInfo($app); @@ -237,16 +239,15 @@ class OC_App{ 'App "'.$info['name'].'" can\'t be installed because it is' .' not compatible with this version of ownCloud', OC_Log::ERROR); - return false; + throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud.")); }else{ OC_Appconfig::setValue( $app, 'enabled', 'yes' ); if(isset($appdata['id'])) { OC_Appconfig::setValue( $app, 'ocsid', $appdata['id'] ); } - return true; } }else{ - return false; + throw new \Exception($l->t("No app name specified")); } } |