X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/111cca8c9ab882d554b072a05d1dfe4afe58657e..5567bda5f0724d4af8ff050bf46372e1c694ae45:/lib-php/Status.php diff --git a/lib-php/Status.php b/lib-php/Status.php index 2d9e78db..4a8f5592 100644 --- a/lib-php/Status.php +++ b/lib-php/Status.php @@ -2,6 +2,8 @@ namespace Nominatim; +require_once(CONST_TokenizerDir.'/tokenizer.php'); + use Exception; class Status @@ -25,24 +27,8 @@ class Status throw new Exception('Database connection failed', 700); } - $sStandardWord = $this->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,7 +37,7 @@ 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;