]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/client/http/class_HttpClient.php
Continued:
[core.git] / framework / main / classes / client / http / class_HttpClient.php
index 20c4c78786bdddca625d582fa5395be18cf31320..eecb89555e0c5962e3838855c1cfeb25078734a0 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Client\Http;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Client\BaseClient;
 use Org\Mxchange\CoreFramework\Client\Client;
 
@@ -11,7 +12,7 @@ use Org\Mxchange\CoreFramework\Client\Client;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -72,7 +73,7 @@ class HttpClient extends BaseClient implements Client {
                // Do we have cache?
                if (!isset($GLOBALS[__METHOD__])) {
                        // Determine it
-                       $GLOBALS[__METHOD__] = (($this->getConfigInstance()->getConfigEntry('proxy_host') != '') && ($this->getConfigInstance()->getConfigEntry('proxy_port') > 0));
+                       $GLOBALS[__METHOD__] = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host') != '') && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port') > 0));
                } // END - if
 
                // Return cache
@@ -111,21 +112,21 @@ class HttpClient extends BaseClient implements Client {
         * @param       $port                   Port number to connect to
         * @return      $responseArray  Array with raw response
         */
-       private function sendRawHttpRequest ($method, $host, $port, array $header = array()) {
+       private function sendRawHttpRequest ($method, $host, $port, array $header = []) {
                // Minimum raw HTTP/1.1 request
                $rawRequest  = $method . ' ' . $host . ':' . $port . ' HTTP/1.1' . self::HTTP_EOL;
                $rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL;
 
                // Use login data to proxy? (username at least)
-               if ($this->getConfigInstance()->getConfigEntry('proxy_username') != '') {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') != '') {
                        // Add it as well
-                       $encodedAuth = base64_encode($this->getConfigInstance()->getConfigEntry('proxy_username') . ':' . $this->getConfigInstance()->getConfigEntry('proxy_password'));
+                       $encodedAuth = base64_encode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') . ':' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_password'));
                        $rawRequest .= 'Proxy-Authorization: Basic ' . $encodedAuth . self::HTTP_EOL;
                } // END - if
 
                // Add last new-line
                $rawRequest .= self::HTTP_EOL;
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HTTP-CLIENT[' . __METHOD__ . ':' . __LINE__ . ']: rawRequest=' . $rawRequest);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HTTP-CLIENT: rawRequest=' . $rawRequest);
 
                // Write request
                fwrite($this->getSocketResource(), $rawRequest);