mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-26 06:22:13 +03:00
return database version with status API
This commit is contained in:
parent
7ae9c3a9f0
commit
111cca8c9a
@ -56,4 +56,10 @@ class Status
|
|||||||
|
|
||||||
return $iDataDateEpoch;
|
return $iDataDateEpoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function databaseVersion()
|
||||||
|
{
|
||||||
|
$sSQL = 'SELECT value FROM nominatim_properties WHERE property = \'database_version\'';
|
||||||
|
return $this->oDB->getOne($sSQL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ if ($sOutputFormat == 'json') {
|
|||||||
'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
|
'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
|
||||||
'software_version' => CONST_NominatimVersion
|
'software_version' => CONST_NominatimVersion
|
||||||
);
|
);
|
||||||
|
$sDatabaseVersion = $oStatus->databaseVersion();
|
||||||
|
if ($sDatabaseVersion) {
|
||||||
|
$aResponse['database_version'] = $sDatabaseVersion;
|
||||||
|
}
|
||||||
javascript_renderData($aResponse);
|
javascript_renderData($aResponse);
|
||||||
} else {
|
} else {
|
||||||
echo 'OK';
|
echo 'OK';
|
||||||
|
Loading…
Reference in New Issue
Block a user