X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/80f6aca0c22984b79e24a19bc602258dd3caeb34..e941a3f00b2944e0d624f395e9a252d29ad4c95c:/lib-php/Status.php diff --git a/lib-php/Status.php b/lib-php/Status.php index a276c4d5..4f1555cd 100644 --- a/lib-php/Status.php +++ b/lib-php/Status.php @@ -1,7 +1,17 @@ oDB->getOne("SELECT make_standard_name('a')"); - if ($sStandardWord === false) { - throw new Exception('Module failed', 701); - } - - if ($sStandardWord != 'a') { - throw new Exception('Module call failed', 702); - } - - $sSQL = 'SELECT word_id, word_token, word, class, type, country_code, '; - $sSQL .= "operator, search_name_count FROM word WHERE word_token IN (' a')"; - $iWordID = $this->oDB->getOne($sSQL); - if ($iWordID === false) { - throw new Exception('Query failed', 703); - } - if (!$iWordID) { - throw new Exception('No value', 704); - } + $oTokenizer = new \Nominatim\Tokenizer($this->oDB); + $oTokenizer->checkStatus(); } public function dataDate() @@ -51,9 +45,15 @@ class Status $iDataDateEpoch = $this->oDB->getOne($sSQL); if ($iDataDateEpoch === false) { - throw Exception('Data date query failed '.$iDataDateEpoch->getMessage(), 705); + throw new Exception('Import date is not available', 705); } return $iDataDateEpoch; } + + public function databaseVersion() + { + $sSQL = 'SELECT value FROM nominatim_properties WHERE property = \'database_version\''; + return $this->oDB->getOne($sSQL); + } }