summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-03-19 08:47:29 +0100
committerBart Visscher <bartv@thisnet.nl>2013-05-07 20:07:28 +0200
commite620286b253bcd43806fa9deab5e2e67decda582 (patch)
treed9e0b487cf88cfdba050d9d1ce41b0dc07adae94 /lib/public
parent07df94def66a78bda40560a5bdd31058f61e2238 (diff)
downloadnextcloud-server-e620286b253bcd43806fa9deab5e2e67decda582.tar.gz
nextcloud-server-e620286b253bcd43806fa9deab5e2e67decda582.zip
Fix returns of values in OCP\Config
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/config.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/public/config.php b/lib/public/config.php
index 8076d640b49..73476d7551d 100644
--- a/lib/public/config.php
+++ b/lib/public/config.php
@@ -49,7 +49,7 @@ class Config {
* $default will be returned.
*/
public static function getSystemValue( $key, $default = null ) {
- return(\OC_Config::getValue( $key, $default ));
+ return \OC_Config::getValue( $key, $default );
}
/**
@@ -62,7 +62,12 @@ class Config {
* not be written, false will be returned.
*/
public static function setSystemValue( $key, $value ) {
- return(\OC_Config::setValue( $key, $value ));
+ try {
+ \OC_Config::setValue( $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
/**
@@ -76,7 +81,7 @@ class Config {
* not exist the default value will be returned
*/
public static function getAppValue( $app, $key, $default = null ) {
- return(\OC_Appconfig::getValue( $app, $key, $default ));
+ return \OC_Appconfig::getValue( $app, $key, $default );
}
/**
@@ -89,7 +94,12 @@ class Config {
* Sets a value. If the key did not exist before it will be created.
*/
public static function setAppValue( $app, $key, $value ) {
- return(\OC_Appconfig::setValue( $app, $key, $value ));
+ try {
+ \OC_Appconfig::setValue( $app, $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
/**
@@ -104,7 +114,7 @@ class Config {
* not exist the default value will be returned
*/
public static function getUserValue( $user, $app, $key, $default = null ) {
- return(\OC_Preferences::getValue( $user, $app, $key, $default ));
+ return \OC_Preferences::getValue( $user, $app, $key, $default );
}
/**
@@ -119,6 +129,11 @@ class Config {
* will be added automagically.
*/
public static function setUserValue( $user, $app, $key, $value ) {
- return(\OC_Preferences::setValue( $user, $app, $key, $value ));
+ try {
+ \OC_Preferences::setValue( $user, $app, $key, $value );
+ } catch (Exception $e) {
+ return false;
+ }
+ return true;
}
}