note 72086 modified in function.stream-context-get-default by rquadling
| From: | rquadling@php.net | Date: | Thu, 25 Nov 2010 14:23:33 +0000 |
| Subject: | note 72086 modified in function.stream-context-get-default by rquadling | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174352@lists.php.net to get a copy of this message | ||
If you are using stream_context_get_default() and are still finding that some functions do not work,
make sure that they are not based upon the libxml functions (DOM, SimpleXML and XSLT). These require
their own context.
You can easily set them using the following code ...
<?php
// Define the default, system-wide context.
$r_default_context = stream_context_get_default
(
array
(
'http' => array
( // All HTTP requests are passed through the local NTLM proxy server on port 8080.
'proxy' => 'tcp://127.0.0.1:8080',
'request_fulluri' => True,
),
)
);
// Though we said system wide, some extensions need a little coaxing.
libxml_set_streams_context($r_default_context);
?>
--was--
If you are using stream_context_get_default() and are still finding that some functions do not work,
make sure that they are not based upon the libxml functions (DOM, SimpleXML and XSLT). These require
their own context.
You can easily set them using the following code ...
<?php
// Define the default, system-wide context.
$r_default_context = stream_context_get_default
(
array
(
'http' => array
( // All HTTP requests are passed through the local NTLM proxy server on port 8080.
'proxy' => 'tcp://127.0.0.1:8080',
'request_fulluri' => True,
),
)
);
// Though we said system wide, some extensions need a little coaxing.
libxml_set_streams_context($r_default_context);
?>
See http://rquadling.php1h.com/php_ntlm.php
for more info (sorry for the ads).
http://php.net/manual/en/function.stream-context-get-default.php