php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63506 Adding openStream() method to XMLWriter
Submitted: 2012-11-13 18:26 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: evert at rooftopsolutions dot nl Assigned:
Status: Open Package: XML Writer
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: evert at rooftopsolutions dot nl
New email:
PHP Version: OS:

 

 [2012-11-13 18:26 UTC] evert at rooftopsolutions dot nl
Description:
------------
It would be extremely handy if, instead of supplying XMLWriter with a uri, we can give it a writeable stream instead, as such;

$h  = fopen('php://output','w');
$xw = new \XMLWriter();
$xw->openStream($h);

This way the XMLWriter does not have to be aware of an output uri.

In my applications (webservices) I simply work with out an output, and an input stream. Different components write to the outputstream, and what they are writing comes from different sources.

Unittests often simply replace the outputstream with php://memory, or php://temp, so the application output can get easily redirected.

Using openUri() I have to break this, which would kind of suck.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 20:01:28 2019 UTC