Index: branches/js2-work/phase3/includes/HttpFunctions.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | // Syncronous download (in a single request) |
13 | 13 | const SYNC_DOWNLOAD = 1; |
14 | 14 | |
15 | | - // Asynchronous download ( background process with multiple requests ) |
| 15 | + // Asynchronous download ( background process with multiple status requests ) |
16 | 16 | const ASYNC_DOWNLOAD = 2; |
17 | 17 | |
18 | 18 | /** |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | } |
68 | 68 | $head = $headResponse->value; |
69 | 69 | |
70 | | - // check for redirects: |
| 70 | + // Check for redirects: |
71 | 71 | if( isset( $head['Location'] ) && strrpos( $head[0], '302' ) !== false ) { |
72 | 72 | if( $redirectCount < $wgMaxRedirects ) { |
73 | 73 | if( self::isValidURI( $head['Location'] ) ) { |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | | - // check if we can find phpCliPath (for doing a background shell request to |
| 96 | + // Check if we can find $wgPhpCli (for doing a background shell request to |
97 | 97 | // php to do the download: |
98 | 98 | if( $wgPhpCli && wfShellExecEnabled() && $dl_mode == self::ASYNC_DOWNLOAD ) { |
99 | 99 | wfDebug( __METHOD__ . "\nASYNC_DOWNLOAD\n" ); |
— | — | @@ -528,12 +528,15 @@ |
529 | 529 | ); |
530 | 530 | |
531 | 531 | // Proxy setup: |
532 | | - if( $this->proxy ){ |
533 | | - $httpContextOptions['proxy'] = 'tcp://' . $this->proxy; |
534 | | - }else if ( Http::isLocalURL( $this->url ) ) { |
535 | | - $httpContextOptions['proxy'] = 'tcp://localhost:80'; |
536 | | - } elseif ( $wgHTTPProxy ) { |
537 | | - $httpContextOptions['proxy'] = 'tcp://' . $wgHTTPProxy ; |
| 532 | + // only do proxy setup if ( not suppressed $this->proxy === false ) |
| 533 | + if( $this->proxy !== false ){ |
| 534 | + if( $this->proxy ){ |
| 535 | + $httpContextOptions['proxy'] = 'tcp://' . $this->proxy; |
| 536 | + }else if ( Http::isLocalURL( $this->url ) ) { |
| 537 | + $httpContextOptions['proxy'] = 'tcp://localhost:80'; |
| 538 | + } elseif ( $wgHTTPProxy ) { |
| 539 | + $httpContextOptions['proxy'] = 'tcp://' . $wgHTTPProxy ; |
| 540 | + } |
538 | 541 | } |
539 | 542 | |
540 | 543 | $fcontext = stream_context_create ( |