diff options
author | Tom Needham <needham.thomas@gmail.com> | 2011-10-03 22:59:40 +0100 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2011-10-03 22:59:40 +0100 |
commit | 02d7b1a1fc8f4bf62bfb973acfa0ee19ffa469ff (patch) | |
tree | dbf59263769a549a09f2aa5af3ccf2c9571bb125 /lib/appconfig.php | |
parent | 0825073e8cac2a654bbc89b99b5a83cdfee7a836 (diff) | |
parent | e8c6252a4ce1151b11f1faa8e602c06aae4294d8 (diff) | |
download | nextcloud-server-02d7b1a1fc8f4bf62bfb973acfa0ee19ffa469ff.tar.gz nextcloud-server-02d7b1a1fc8f4bf62bfb973acfa0ee19ffa469ff.zip |
Added breadcrumb and control bar.
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r-- | lib/appconfig.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php index 392782b2586..f43ef141732 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -100,7 +100,18 @@ class OC_Appconfig{ return $default; } } - + + /** + * @brief check if a key is set in the appconfig + * @param string $app + * @param string $key + * @return bool + */ + public static function hasKey($app,$key){ + $exists = self::getKeys( $app ); + return in_array( $key, $exists ); + } + /** * @brief sets a value in the appconfig * @param $app app @@ -112,10 +123,7 @@ class OC_Appconfig{ */ public static function setValue( $app, $key, $value ){ // Does the key exist? yes: update. No: insert - $exists = self::getKeys( $app ); - - // null: does not exist - if( !in_array( $key, $exists )){ + if(! self::hasKey($app,$key)){ $query = OC_DB::prepare( 'INSERT INTO *PREFIX*appconfig ( appid, configkey, configvalue ) VALUES( ?, ?, ? )' ); $query->execute( array( $app, $key, $value )); } |