]> git.openstreetmap.org Git - nominatim.git/commitdiff
report software version of status call
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 15:47:19 +0000 (16:47 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 15:47:19 +0000 (16:47 +0100)
lib-php/website/status.php
nominatim/tools/refresh.py

index 9f030fb3ea38314047b50973bc6929aa80117de3..3bb2ffa1828c7a00e72fbc620403a26d04b18b8f 100644 (file)
@@ -37,7 +37,8 @@ if ($sOutputFormat == 'json') {
     $aResponse = array(
                   'status' => 0,
                   'message' => 'OK',
     $aResponse = array(
                   'status' => 0,
                   'message' => 'OK',
-                  'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339)
+                  'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
+                  'software_version' => CONST_NominatimVersion
                  );
     javascript_renderData($aResponse);
 } else {
                  );
     javascript_renderData($aResponse);
 } else {
index b59c37bf9d5b46f1e74053ea3fd2c14621f5714b..5cfa1ab00e92a46d941bd1c55a3d7effbf6d38f1 100644 (file)
@@ -9,6 +9,7 @@ from textwrap import dedent
 from psycopg2.extras import execute_values
 
 from ..db.utils import execute_file
 from psycopg2.extras import execute_values
 
 from ..db.utils import execute_file
+from ..version import NOMINATIM_VERSION
 
 LOG = logging.getLogger()
 
 
 LOG = logging.getLogger()
 
@@ -258,9 +259,10 @@ def setup_website(basedir, phplib_dir, config):
                       <?php
 
                       @define('CONST_Debug', $_GET['debug'] ?? false);
                       <?php
 
                       @define('CONST_Debug', $_GET['debug'] ?? false);
-                      @define('CONST_LibDir', '{}');
+                      @define('CONST_LibDir', '{0}');
+                      @define('CONST_NominatimVersion', '{1[0]}.{1[1]}.{1[2]}-{1[3]}');
 
 
-                      """.format(phplib_dir))
+                      """.format(phplib_dir, NOMINATIM_VERSION))
 
     for php_name, conf_name, var_type in PHP_CONST_DEFS:
         if var_type == bool:
 
     for php_name, conf_name, var_type in PHP_CONST_DEFS:
         if var_type == bool: