]> git.openstreetmap.org Git - nominatim.git/blob - website/status.php
Fix coding style.
[nominatim.git] / website / status.php
1 <?php
2         @define('CONST_ConnectionBucket_PageType', 'Status');
3
4         require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
5         require_once(CONST_BasePath.'/lib/init-website.php');
6
7         function statusError($sMsg)
8         {
9                 header("HTTP/1.0 500 Internal Server Error");
10                 echo "ERROR: ".$sMsg;
11                 exit;
12         }
13
14         $oDB =& DB::connect(CONST_Database_DSN, false);
15         if (!$oDB || PEAR::isError($oDB))
16         {
17                 statusError("No database");
18         }
19
20         $sStandardWord = $oDB->getOne("select make_standard_name('a')");
21         if (PEAR::isError($sStandardWord))
22         {
23                 statusError("Module failed");
24         }
25         if ($sStandardWord != 'a')
26         {
27                 statusError("Module call failed");
28         }
29
30         $iWordID = $oDB->getOne("select word_id,word_token, word, class, type, country_code, operator, search_name_count from word where word_token in (' a')");
31         if (PEAR::isError($iWordID))
32         {
33                 statusError("Query failed");
34         }
35         if (!$iWordID)
36         {
37                 statusError("No value");
38         }
39
40         echo "OK";
41         exit;
42