]> git.openstreetmap.org Git - nominatim.git/blob - website/last_update.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / last_update.php
1 <?php
2         @define('CONST_ConnectionBucket_PageType', 'Status');
3
4         require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
5
6         function statusError($sMsg)
7         {
8                 header("HTTP/1.0 500 Internal Server Error");
9                 echo "ERROR: ".$sMsg;
10                 exit;
11         }
12
13         $oDB =& DB::connect(CONST_Database_DSN, false);
14         if (!$oDB || PEAR::isError($oDB))
15         {
16                 statusError("No database");
17         }
18
19         $sLastUpdate = $oDB->getOne("select * from import_status");
20         if (PEAR::isError($sLastUpdate))
21         {
22                 statusError("Update status unknown.");
23         }
24         echo $sLastUpdate;
25         exit;
26