]> git.openstreetmap.org Git - nominatim.git/commitdiff
return database version with status API
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 21:17:16 +0000 (22:17 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 21:17:16 +0000 (22:17 +0100)
lib-php/Status.php
lib-php/website/status.php

index a276c4d5faa2c8ffe6d2bb672a5085c384ddd393..2d9e78db42606f59a90cb2d6e18ad4d8774a6a2e 100644 (file)
@@ -56,4 +56,10 @@ class Status
 
         return $iDataDateEpoch;
     }
+
+    public function databaseVersion()
+    {
+        $sSQL = 'SELECT value FROM nominatim_properties WHERE property = \'database_version\'';
+        return $this->oDB->getOne($sSQL);
+    }
 }
index 3bb2ffa1828c7a00e72fbc620403a26d04b18b8f..7c7eb9281c5e449fb09a52f18ce8c1153273e7e7 100644 (file)
@@ -40,6 +40,10 @@ if ($sOutputFormat == 'json') {
                   'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
                   'software_version' => CONST_NominatimVersion
                  );
+    $sDatabaseVersion = $oStatus->databaseVersion();
+    if ($sDatabaseVersion) {
+        $aResponse['database_version'] = $sDatabaseVersion;
+    }
     javascript_renderData($aResponse);
 } else {
     echo 'OK';