]> git.openstreetmap.org Git - nominatim.git/blob - lib/init-cmd.php
small typos and wording in the API docs
[nominatim.git] / lib / init-cmd.php
1 <?php
2
3 require_once('init.php');
4 require_once('cmd.php');
5 require_once('DebugNone.php');
6
7 // handle http proxy when using file_get_contents
8 if (CONST_HTTP_Proxy) {
9     $proxy = 'tcp://' . CONST_HTTP_Proxy_Host . ':' . CONST_HTTP_Proxy_Port;
10     $aHeaders = array();
11     if (CONST_HTTP_Proxy_Login != null && CONST_HTTP_Proxy_Login != '' && CONST_HTTP_Proxy_Password != null && CONST_HTTP_Proxy_Password != '') {
12         $auth = base64_encode(CONST_HTTP_Proxy_Login . ':' . CONST_HTTP_Proxy_Password);
13         $aHeaders = array("Proxy-Authorization: Basic $auth");
14     }
15     $aContext = array(
16                  'http' => array(
17                             'proxy' => $proxy,
18                             'request_fulluri' => true,
19                             'header' => $aHeaders
20                            ),
21                  'https' => array(
22                              'proxy' => $proxy,
23                              'request_fulluri' => true,
24                              'header' => $aHeaders
25                             )
26                 );
27     stream_context_set_default($aContext);
28 }