Edit report at http://bugs.php.net/bug.php?id=54440&edit=1

 ID:                 54440
 User updated by:    jpa...@php.net
 Reported by:        jpa...@php.net
 Summary:            stream_context_set_default() should publish the
                     default context to everybody
 Status:             Open
 Type:               Bug
 Package:            Streams related
 Operating System:   *nix
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

See also #52926


Previous Comments:
------------------------------------------------------------------------
[2011-04-01 11:43:32] jpa...@php.net

Description:
------------
stream_context_set_default() doesn't publish the context to all PHP
extension.



Example is ext/libxml that doesn't recognize the context.

Test script:
---------------
stream_context_set_default(array('http'=>array('proxy'=>'my_proxy_url')));



$x = simplexml_load_file('http://some_resource');

Expected result:
----------------
The resource gets loaded through the HTTP proxy

Actual result:
--------------
The resource is not loaded through the HTTP proxy.

For this to work, we have to use :



$ctx =
stream_context_create(array('http'=>array('proxy'=>'my_proxy_url')));

libxml_set_streams_context($ctx); // userland manual bind



$x = simplexml_load_file('http://some_resource');


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54440&edit=1

Reply via email to