#20899 [Opn->]: DOM Objects saved in current session can't be accessed after the initial page

From: Date: Mon, 09 Dec 2002 11:36:50 +0000
Subject: #20899 [Opn->]: DOM Objects saved in current session can't be accessed after the initial page
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27156@lists.php.net to get a copy of this message
ID: 20899 Updated by: chregu@php.net Reported By: jalonso@art3mis.com -Status: Open +Status: Won\'t fix Bug Type: DOM XML related Operating System: Debian Linux 3.0 PHP Version: 4.3.0RC2 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2002-12-09 05:30:46] jalonso@art3mis.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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20899&edit=1

« previous php.bugs (#27156) next »