X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7075a5828e658cda653955096932a610bbbe0f99..bb6c8d45fe688b593caedf359a3c19acfec7dad1:/website/status.php diff --git a/website/status.php b/website/status.php index 262fe8e0..9f030fb3 100644 --- a/website/status.php +++ b/website/status.php @@ -1,18 +1,13 @@ getSet('format', array('text', 'json'), 'text'); -$oDB = DB::connect(CONST_Database_DSN, false); -$oStatus = new Nominatim\Status($oDB); - +$oDB = new Nominatim\DB(CONST_Database_DSN); if ($sOutputFormat == 'json') { header('content-type: application/json; charset=UTF-8'); @@ -20,13 +15,14 @@ if ($sOutputFormat == 'json') { try { + $oStatus = new Nominatim\Status($oDB); $oStatus->status(); } catch (Exception $oErr) { if ($sOutputFormat == 'json') { $aResponse = array( - 'status' => $oErr->getCode(), - 'message' => $oErr->getMessage() - ); + 'status' => $oErr->getCode(), + 'message' => $oErr->getMessage() + ); javascript_renderData($aResponse); } else { header('HTTP/1.0 500 Internal Server Error'); @@ -39,10 +35,10 @@ try { if ($sOutputFormat == 'json') { $epoch = $oStatus->dataDate(); $aResponse = array( - 'status' => 0, - 'message' => 'OK', - 'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339) - ); + 'status' => 0, + 'message' => 'OK', + 'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339) + ); javascript_renderData($aResponse); } else { echo 'OK';