Permalink
Browse files

Extend Request.php to include Http Proxy support

Extended Request.php to allow for configurable Http Proxy support when using 'context' format. See http://www.php.net/manual/en/function.stream-context-create.php#92586
  • Loading branch information...
1 parent ddc1dc1 commit 705258038e45284cf8aa3c985c0dd740304f19ad @ericcholis ericcholis committed with nateabele Jul 30, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 net/http/Request.php
View
@@ -76,7 +76,8 @@ public function __construct(array $config = array()) {
'headers' => array(),
'body' => null,
'auth' => null,
- 'method' => 'GET'
+ 'method' => 'GET',
+ 'proxy' => null
);
$config += $defaults;
parent::__construct($config);
@@ -211,12 +212,14 @@ public function to($format, array $options = array()) {
'username' => $this->username,
'password' => $this->password,
'headers' => array(),
+ 'proxy' => $this->proxy,
'body' => null,
'version' => $this->version,
'ignore_errors' => isset($this->_config['ignore_errors'])
? $this->_config['ignore_errors'] : true,
'follow_location' => isset($this->_config['follow_location'])
- ? $this->_config['follow_location'] : true
+ ? $this->_config['follow_location'] : true,
+ 'request_fulluri' => isset($this->proxy)
);
$options += $defaults;

0 comments on commit 7052580

Please sign in to comment.