]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache result of OC_App::getAppVersions
authorBart Visscher <bartv@thisnet.nl>
Tue, 26 Jun 2012 18:53:28 +0000 (20:53 +0200)
committerBart Visscher <bartv@thisnet.nl>
Tue, 26 Jun 2012 23:05:12 +0000 (01:05 +0200)
lib/app.php

index be17beeacc513038bb2106b82f87e7843c4e51c0..a9feff1620ab2f17a688fefdb3c779e3d9ac25dd 100755 (executable)
@@ -567,6 +567,10 @@ class OC_App{
         * get the installed version of all papps
         */
        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();
                $query = OC_DB::prepare( 'SELECT appid, configvalue FROM *PREFIX*appconfig WHERE configkey = \'installed_version\'' );
                $result = $query->execute();