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;
*
* @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
*
// 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
* @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);