mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 10:57:40 +02:00
parent
356530de81
commit
c008300b86
@ -466,6 +466,7 @@ abstract class ApplicationBootstrap
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$this->config = Config::app();
|
$this->config = Config::app();
|
||||||
|
$this->setupProxy();
|
||||||
} catch (NotReadableError $e) {
|
} catch (NotReadableError $e) {
|
||||||
Logger::error(new IcingaException('Cannot load application configuration. An exception was thrown:', $e));
|
Logger::error(new IcingaException('Cannot load application configuration. An exception was thrown:', $e));
|
||||||
$this->config = new Config();
|
$this->config = new Config();
|
||||||
@ -626,6 +627,31 @@ abstract class ApplicationBootstrap
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up the proxy
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function setupProxy()
|
||||||
|
{
|
||||||
|
if (! (bool) $this->config->get('global', 'use_proxy')) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$proxyConfig = $this->config->getSection('proxy');
|
||||||
|
|
||||||
|
$defaultOpts = array(
|
||||||
|
'http' => array(
|
||||||
|
'proxy' => $proxyConfig->get('http'),
|
||||||
|
'request_fulluri' => (bool) $proxyConfig->get('http_request_fulluri'),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
stream_context_set_default($defaultOpts);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string Our locale directory
|
* @return string Our locale directory
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user