X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Fclasses%2Fclient%2Fhttp%2Fclass_HttpClient.php;h=eecb89555e0c5962e3838855c1cfeb25078734a0;hb=498e6b065ce47804bff4e1073592a2cc8e28f8ef;hp=20c4c78786bdddca625d582fa5395be18cf31320;hpb=bed81d8edc3673951a1ee57f38f5a1a07c417b69;p=core.git diff --git a/framework/main/classes/client/http/class_HttpClient.php b/framework/main/classes/client/http/class_HttpClient.php index 20c4c787..eecb8955 100644 --- a/framework/main/classes/client/http/class_HttpClient.php +++ b/framework/main/classes/client/http/class_HttpClient.php @@ -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 * @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);