php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20899 DOM Objects saved in current session can't be accessed after the initial page
Submitted: 2002-12-09 05:30 UTC Modified: 2002-12-09 05:36 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jalonso at art3mis dot com Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.0RC2 OS: Debian Linux 3.0
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: jalonso at art3mis dot com
New email:
PHP Version: OS:

 

 [2002-12-09 05:30 UTC] jalonso at art3mis dot com
Imagine this scenario: You load an XML file (with configuration data) into the current session along with some custom methods to change data in the XML object in memory to , finally, save your changes.

But actually you can't use DOM Methods like dump_mem() after registering your DOM object in the current session.

Try this script:

-------------------------------------
<?php
session_start();

if (!isset($_SESSION['doc']))
  $_SESSION['doc'] = domxml_open_file('lalala.xml');

$_SESSION['doc']->dump_mem();
?>
<a href="<?=$_SERVER['SCRIPT_NAME']?>">click</a>
--------------------------------------

lalala.xml is a valid xml file.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-09 05:36 UTC] chregu@php.net
This is not possible and most presumably never will be possible. We would have to store the actual xml-data somewhere, but php knows only the pointer to the xml-data which is handled by the libxml2-library and this stuff gets freed after script-end.

you have to parse and save it everytime or use your own xml-structure built with php-objects, like maybe XML_Tree from PEAR (never tested that, though)

chregu
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 01:03:38 2021 UTC