mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Use appconfig for getAppVersions
This commit is contained in:
parent
df2abda814
commit
ae7c49f93c
1 changed files with 5 additions and 14 deletions
|
|
@ -1022,21 +1022,12 @@ class OC_App {
|
|||
*/
|
||||
public static function getAppVersions() {
|
||||
static $versions;
|
||||
if (isset($versions)) { // simple cache, needs to be fixed
|
||||
return $versions; // when function is used besides in checkUpgrade
|
||||
}
|
||||
$versions = array();
|
||||
try {
|
||||
$query = OC_DB::prepare('SELECT `appid`, `configvalue` FROM `*PREFIX*appconfig`'
|
||||
. ' WHERE `configkey` = \'installed_version\'');
|
||||
$result = $query->execute();
|
||||
while ($row = $result->fetchRow()) {
|
||||
$versions[$row['appid']] = $row['configvalue'];
|
||||
}
|
||||
return $versions;
|
||||
} catch (\Exception $e) {
|
||||
return array();
|
||||
|
||||
if(!$versions) {
|
||||
$appConfig = \OC::$server->getAppConfig();
|
||||
$versions = $appConfig->getValues(false, 'installed_version');
|
||||
}
|
||||
return $versions;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue