]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/client/http/class_HttpClient.ph
Rewrite continued:
[core.git] / framework / main / classes / client / http / class_HttpClient.ph
index 76a311331ebe972fcb09402f26e97d95f5fa0bf1..db79276a083632009b5eb02cb44ae24a9ba58c34 100644 (file)
                // @TODO Add some DNS caching here
 
                // Open connection
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = $helperInstance->resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+
+                       // @TODO Handle $ip = false
 
                        // Connect to host through proxy connection
                        $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } // END - if
 
                // Prepare the GET request
-               $request  = 'GET ' . ($helperInstance->isProxyUsed() === TRUE ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+               $request  = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
                $request .= 'Host: shipsimu.org' . self::HTTP_EOL;
                $request .= 'User-Agent: ' . $this->getUserAgent() . self::HTTP_EOL;
                $request .= 'Connection: close' . self::HTTP_EOL;
 
                // Do we use proxy?
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // CONNECT method?
                        if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
                                // Setup proxy tunnel
@@ -55,7 +57,7 @@
                                // If the response is invalid, abort
                                if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
                                        // Invalid response!
-                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, TRUE));
+                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
                                } // END - if
                        } else {
                                // Add header for proxy