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: 2024-06-29 16:08 UTC
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: nielsdos (profile)
Status: Closed Package: XML Writer
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 + 13 = ?
Subscribe to this entry?

 
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2024-06-29 16:08 UTC] nielsdos@php.net
This is implemented in PHP-8.4-dev (as toStream()).
 [2024-06-29 16:08 UTC] nielsdos@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nielsdos
 [2024-06-29 16:08 UTC] nielsdos@php.net
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 27 02:01:29 2024 UTC