summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authoricewind1991 <icewind1991@gmail.com>2013-07-11 18:21:08 -0700
committericewind1991 <icewind1991@gmail.com>2013-07-11 18:21:08 -0700
commit3abe68176ff09ca579ff9e5f15872fb5cab8ff4d (patch)
tree705cd981b31256472256d11726423cc2e8c9126d /lib/public
parent3fbf7ab189b96246cfcc3c6904d813f7eaa42c42 (diff)
parente7b882a4fcfbc5210d64372ba170efa825ebc237 (diff)
downloadnextcloud-server-3abe68176ff09ca579ff9e5f15872fb5cab8ff4d.tar.gz
nextcloud-server-3abe68176ff09ca579ff9e5f15872fb5cab8ff4d.zip
Merge pull request #3270 from owncloud/convert-oc_config
Convert OC_Config to object so it can be used for DI
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;
}
}