mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-24 18:37:52 +02:00
parent
356530de81
commit
c008300b86
@ -466,6 +466,7 @@ abstract class ApplicationBootstrap
|
||||
|
||||
try {
|
||||
$this->config = Config::app();
|
||||
$this->setupProxy();
|
||||
} catch (NotReadableError $e) {
|
||||
Logger::error(new IcingaException('Cannot load application configuration. An exception was thrown:', $e));
|
||||
$this->config = new Config();
|
||||
@ -626,6 +627,31 @@ abstract class ApplicationBootstrap
|
||||
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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user