Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-01 16:14:30 +0400
committerRobin Appelman <icewind@owncloud.com>2014-06-01 16:14:30 +0400
commita4949f4b31e86650ac2ccfe547fa64494b08dbff (patch)
treebf979d6942917b659b8c6fb908cb92651226b341 /lib/private/appconfig.php
parent91180bfef487ae5e9fcf7890b9b28746c02839cd (diff)
Simplify AppConfig->getValues()
Diffstat (limited to 'lib/private/appconfig.php')
-rw-r--r--lib/private/appconfig.php28
1 files changed, 9 insertions, 19 deletions
diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php
index d4ad20816eb..196d04aa9a5 100644
--- a/lib/private/appconfig.php
+++ b/lib/private/appconfig.php
@@ -251,28 +251,18 @@ class AppConfig implements \OCP\IAppConfig {
return false;
}
- $fields = '`configvalue`';
- $where = 'WHERE';
- $params = array();
if ($app !== false) {
- $fields .= ', `configkey`';
- $where .= ' `appid` = ?';
- $params[] = $app;
- $key = 'configkey';
+ return $this->getAppValues($app);
} else {
- $fields .= ', `appid`';
- $where .= ' `configkey` = ?';
- $params[] = $key;
- $key = 'appid';
- }
- $query = 'SELECT ' . $fields . ' FROM `*PREFIX*appconfig` ' . $where;
- $result = $this->conn->executeQuery($query, $params);
+ $query = 'SELECT `configvalue`, `appid` FROM `*PREFIX*appconfig` WHERE `configkey` = ?';
+ $result = $this->conn->executeQuery($query, array($key));
- $values = array();
- while ($row = $result->fetch((\PDO::FETCH_ASSOC))) {
- $values[$row[$key]] = $row['configvalue'];
- }
+ $values = array();
+ while ($row = $result->fetch((\PDO::FETCH_ASSOC))) {
+ $values[$row['appid']] = $row['configvalue'];
+ }
- return $values;
+ return $values;
+ }
}
}