Simplify AppConfig->getValues()
This commit is contained in:
parent
91180bfef4
commit
a4949f4b31
|
@ -251,28 +251,18 @@ class AppConfig implements \OCP\IAppConfig {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = '`configvalue`';
|
|
||||||
$where = 'WHERE';
|
|
||||||
$params = array();
|
|
||||||
if ($app !== false) {
|
if ($app !== false) {
|
||||||
$fields .= ', `configkey`';
|
return $this->getAppValues($app);
|
||||||
$where .= ' `appid` = ?';
|
|
||||||
$params[] = $app;
|
|
||||||
$key = 'configkey';
|
|
||||||
} else {
|
} else {
|
||||||
$fields .= ', `appid`';
|
$query = 'SELECT `configvalue`, `appid` FROM `*PREFIX*appconfig` WHERE `configkey` = ?';
|
||||||
$where .= ' `configkey` = ?';
|
$result = $this->conn->executeQuery($query, array($key));
|
||||||
$params[] = $key;
|
|
||||||
$key = 'appid';
|
|
||||||
}
|
|
||||||
$query = 'SELECT ' . $fields . ' FROM `*PREFIX*appconfig` ' . $where;
|
|
||||||
$result = $this->conn->executeQuery($query, $params);
|
|
||||||
|
|
||||||
$values = array();
|
$values = array();
|
||||||
while ($row = $result->fetch((\PDO::FETCH_ASSOC))) {
|
while ($row = $result->fetch((\PDO::FETCH_ASSOC))) {
|
||||||
$values[$row[$key]] = $row['configvalue'];
|
$values[$row['appid']] = $row['configvalue'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue