- $fds = array(0 => array('pipe', 'r'),
- 1 => STDOUT,
- 2 => STDERR);
- $pipes = null;
- $proc = @proc_open($cmd, $fds, $pipes, null, $env);
- if (!is_resource($proc)) {
- fail('unable to run command:' . $cmd);
+ if (!getSettingBool('HTTP_PROXY')) {
+ return;
+ }
+
+ $sProxy = 'tcp://'.getSetting('HTTP_PROXY_HOST').':'.getSetting('HTTP_PROXY_PROT');
+ $aHeaders = array();
+
+ $sLogin = getSetting('HTTP_PROXY_LOGIN');
+ $sPassword = getSetting('HTTP_PROXY_PASSWORD');
+
+ if ($sLogin && $sPassword) {
+ $sAuth = base64_encode($sLogin.':'.$sPassword);
+ $aHeaders = array('Proxy-Authorization: Basic '.$sAuth);