]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/reverse.php
Merge pull request #1318 from mtmail/php-pdo
[nominatim.git] / website / reverse.php
old mode 100755 (executable)
new mode 100644 (file)
index 963f750..e1a1b67
@@ -1,7 +1,5 @@
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Reverse');
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
@@ -18,7 +16,8 @@ set_exception_handler_by_format($sOutputFormat);
 // Preferred language
 $aLangPrefOrder = $oParams->getPreferredLanguages();
 
-$oDB =& getDB();
+$oDB = new Nominatim\DB();
+$oDB->connect();
 
 $hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
 
@@ -68,6 +67,7 @@ if (isset($aPlace)) {
     $aPlace = array();
 }
 
+logEnd($oDB, $hLog, count($aPlace) ? 1 : 0);
 
 if (CONST_Debug) {
     var_dump($aPlace);