5 require_once(CONST_TokenizerDir.'/tokenizer.php');
13 public function __construct(&$oDB)
18 public function status()
21 throw new Exception('No database', 700);
25 $this->oDB->connect();
26 } catch (\Nominatim\DatabaseError $e) {
27 throw new Exception('Database connection failed', 700);
30 $oTokenizer = new \Nominatim\Tokenizer($this->oDB);
31 $oTokenizer->checkStatus();
34 public function dataDate()
36 $sSQL = 'SELECT EXTRACT(EPOCH FROM lastimportdate) FROM import_status LIMIT 1';
37 $iDataDateEpoch = $this->oDB->getOne($sSQL);
39 if ($iDataDateEpoch === false) {
40 throw Exception('Data date query failed '.$iDataDateEpoch->getMessage(), 705);
43 return $iDataDateEpoch;
46 public function databaseVersion()
48 $sSQL = 'SELECT value FROM nominatim_properties WHERE property = \'database_version\'';
49 return $this->oDB->getOne($sSQL);