summaryrefslogtreecommitdiffstats
path: root/lib/appconfig.php
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2012-09-07 15:22:01 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2012-09-07 15:22:01 +0200
commit3829460ab8cbb6de65c53583a20fd04cbe7927dd (patch)
tree4dc24845a5eb31b17510a621e14c15b51f16bf7b /lib/appconfig.php
parent785aa751bb5f9a4bcdd677b96207550482e17d3c (diff)
downloadnextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.tar.gz
nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.zip
adding space between) and {
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r--lib/appconfig.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php
index 0e608b540bd..7f58b878504 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -45,13 +45,13 @@ class OC_Appconfig{
* This function returns a list of all apps that have at least one
* entry in the appconfig table.
*/
- public static function getApps(){
+ public static function getApps() {
// No magic in here!
$query = OC_DB::prepare( 'SELECT DISTINCT `appid` FROM `*PREFIX*appconfig`' );
$result = $query->execute();
$apps = array();
- while( $row = $result->fetchRow()){
+ while( $row = $result->fetchRow()) {
$apps[] = $row["appid"];
}
@@ -66,13 +66,13 @@ class OC_Appconfig{
* This function gets all keys of an app. Please note that the values are
* not returned.
*/
- public static function getKeys( $app ){
+ public static function getKeys( $app ) {
// No magic in here as well
$query = OC_DB::prepare( 'SELECT `configkey` FROM `*PREFIX*appconfig` WHERE `appid` = ?' );
$result = $query->execute( array( $app ));
$keys = array();
- while( $row = $result->fetchRow()){
+ while( $row = $result->fetchRow()) {
$keys[] = $row["configkey"];
}
@@ -89,12 +89,12 @@ class OC_Appconfig{
* This function gets a value from the appconfig table. If the key does
* not exist the default value will be returnes
*/
- public static function getValue( $app, $key, $default = null ){
+ public static function getValue( $app, $key, $default = null ) {
// At least some magic in here :-)
$query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*appconfig` WHERE `appid` = ? AND `configkey` = ?' );
$result = $query->execute( array( $app, $key ));
$row = $result->fetchRow();
- if($row){
+ if($row) {
return $row["configvalue"];
}else{
return $default;
@@ -107,7 +107,7 @@ class OC_Appconfig{
* @param string $key
* @return bool
*/
- public static function hasKey($app,$key){
+ public static function hasKey($app,$key) {
$exists = self::getKeys( $app );
return in_array( $key, $exists );
}
@@ -121,9 +121,9 @@ class OC_Appconfig{
*
* Sets a value. If the key did not exist before it will be created.
*/
- public static function setValue( $app, $key, $value ){
+ public static function setValue( $app, $key, $value ) {
// Does the key exist? yes: update. No: insert
- if(! self::hasKey($app,$key)){
+ if(! self::hasKey($app,$key)) {
$query = OC_DB::prepare( 'INSERT INTO `*PREFIX*appconfig` ( `appid`, `configkey`, `configvalue` ) VALUES( ?, ?, ? )' );
$query->execute( array( $app, $key, $value ));
}
@@ -141,7 +141,7 @@ class OC_Appconfig{
*
* Deletes a key.
*/
- public static function deleteKey( $app, $key ){
+ public static function deleteKey( $app, $key ) {
// Boring!
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*appconfig` WHERE `appid` = ? AND `configkey` = ?' );
$query->execute( array( $app, $key ));
@@ -156,7 +156,7 @@ class OC_Appconfig{
*
* Removes all keys in appconfig belonging to the app.
*/
- public static function deleteApp( $app ){
+ public static function deleteApp( $app ) {
// Nothing special
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*appconfig` WHERE `appid` = ?' );
$query->execute( array( $app ));
@@ -170,14 +170,14 @@ class OC_Appconfig{
* @param key
* @return array
*/
- public static function getValues($app,$key){
- if($app!==false and $key!==false){
+ public static function getValues($app,$key) {
+ if($app!==false and $key!==false) {
return false;
}
$fields='`configvalue`';
$where='WHERE';
$params=array();
- if($app!==false){
+ if($app!==false) {
$fields.=', `configkey`';
$where.=' `appid` = ?';
$params[]=$app;
@@ -192,7 +192,7 @@ class OC_Appconfig{
$query=OC_DB::prepare($queryString);
$result=$query->execute($params);
$values=array();
- while($row=$result->fetchRow()){
+ while($row=$result->fetchRow()) {
$values[$row[$key]]=$row['configvalue'];
}
return $values;