Nominatim/website/status.php

42 lines
839 B
PHP
Raw Normal View History

<?php
2013-04-13 00:45:24 +04:00
@define('CONST_ConnectionBucket_PageType', 'Status');
2013-04-13 00:45:24 +04:00
require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
2014-01-23 20:48:20 +04:00
function statusError($sMsg)
{
header("HTTP/1.0 500 Internal Server Error");
echo "ERROR: ".$sMsg;
exit;
}
2013-04-13 00:45:24 +04:00
$oDB =& getDB();
if (!$oDB || PEAR::isError($oDB))
{
2014-01-23 20:48:20 +04:00
statusError("No database");
}
2014-01-23 20:06:43 +04:00
$sStandardWord = $oDB->getOne("select make_standard_name('a')");
if (PEAR::isError($sStandardWord))
{
2014-01-23 20:48:20 +04:00
statusError("Module failed");
2014-01-23 20:06:43 +04:00
}
if ($sStandardWord != 'a')
{
2014-01-23 20:48:20 +04:00
statusError("Module call failed");
2014-01-23 20:06:43 +04:00
}
$iWordID = $oDB->getOne("select word_id,word_token, word, class, type, country_code, operator, search_name_count from word where word_token in (' a')");
if (PEAR::isError($iWordID))
{
2014-01-23 20:48:20 +04:00
statusError("Query failed");
}
if (!$iWordID)
{
2014-01-23 20:48:20 +04:00
statusError("No value");
}
2014-01-23 20:48:20 +04:00
echo "OK";
exit;