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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Fri Jul 19 04:01:25 2019 UTC