diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-03 16:53:30 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-11 11:59:24 +0100 |
commit | ae7c49f93c7de919d0859abb5c75695c194dd2ff (patch) | |
tree | e181b72cabfbe399f7bdd352e49c66207d141360 | |
parent | df2abda814e8909136a27fdac136dc15e62fe429 (diff) | |
download | nextcloud-server-ae7c49f93c7de919d0859abb5c75695c194dd2ff.tar.gz nextcloud-server-ae7c49f93c7de919d0859abb5c75695c194dd2ff.zip |
Use appconfig for getAppVersions
-rw-r--r-- | lib/private/app.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 705d60cf8d6..bfec84759f5 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -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; } |