dont re-read the config values for an app when a non existing key is fetched
This commit is contained in:
parent
47245e7417
commit
2e195dbdae
|
@ -41,6 +41,8 @@ class OC_Appconfig {
|
||||||
|
|
||||||
private static $cache = array();
|
private static $cache = array();
|
||||||
|
|
||||||
|
private static $appsLoaded = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get all apps using the config
|
* @brief Get all apps using the config
|
||||||
* @return array with app ids
|
* @return array with app ids
|
||||||
|
@ -86,11 +88,14 @@ class OC_Appconfig {
|
||||||
if (!isset(self::$cache[$app])) {
|
if (!isset(self::$cache[$app])) {
|
||||||
self::$cache[$app] = array();
|
self::$cache[$app] = array();
|
||||||
}
|
}
|
||||||
$query = OC_DB::prepare('SELECT `configvalue`, `configkey` FROM `*PREFIX*appconfig`'
|
if (array_search($app, self::$appsLoaded) === false) {
|
||||||
. ' WHERE `appid` = ?');
|
$query = OC_DB::prepare('SELECT `configvalue`, `configkey` FROM `*PREFIX*appconfig`'
|
||||||
$result = $query->execute(array($app));
|
. ' WHERE `appid` = ?');
|
||||||
while ($row = $result->fetchRow()) {
|
$result = $query->execute(array($app));
|
||||||
self::$cache[$app][$row['configkey']] = $row['configvalue'];
|
while ($row = $result->fetchRow()) {
|
||||||
|
self::$cache[$app][$row['configkey']] = $row['configvalue'];
|
||||||
|
}
|
||||||
|
self::$appsLoaded[] = $app;
|
||||||
}
|
}
|
||||||
return self::$cache[$app];
|
return self::$cache[$app];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue