Bug #13869 Updated: Object are not correctly serialized

From: Date: Tue, 20 Nov 2001 16:03:21 +0000
Subject: Bug #13869 Updated: Object are not correctly serialized
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-71089@lists.php.net to get a copy of this message
ID: 13869 Updated by: sander Reported By: tkessler@ibelgique.com Old Status: Feedback Status: Closed Bug Type: Session related Operating System: Linux Red-Hat 7.1 PHP Version: 4.0.6 New Comment: No feedback. Closing. Previous Comments: ------------------------------------------------------------------------ [2001-10-30 08:05:18] hholzgra@php.net changed to feedback status ------------------------------------------------------------------------ [2001-10-30 08:04:01] hholzgra@php.net if this is really the complete code then i'd guess you have session.auto_start enabled in your php.ini? if not then i'd recomend you create a special include file for session startup that includes all your class definitions and calls session_start() on its last line include this file at the very top of every file that uses session data so that you can ensure that you have all class definitions read in *before* the session file is read there is no feature for automagicaly including class definitions for objects in a session (yet) as we do not have a 1:1 mapping between file and class names as java has so that the engine has no way to figure out which file to include for an object ------------------------------------------------------------------------ [2001-10-30 07:17:08] tkessler@ibelgique.com This bug made me searching 4 days... First take a class definition in a file called "testclass.php": class test{ var $attribut; } -------------------------------------------------- Then make a "main.php" who contains : session_start(); //HTML header echo "<html>"; //Define frames echo '<frameset rows="80,*" border='.$bord_horz_size.' frameborder="yes" bordercolor='.$col_bord_horz.'>'; echo '<frame name="status-frame" noresize scrolling="no" src="/status_gen/status_gen.php">'; echo '<frameset cols="250,*" border='.$bord_vert_size.' frameborder="yes" bordercolor='.$col_bord_vert.'>'; echo '<frame name="menu-frame" noresize scrolling="no" src="/menu_gen/menu_gen.php">'; //THE main frame : echo '<frame name="main-frame" noresize src="/mainframe/mainframe.php">'; //End of the frames echo "</frameset>"; echo "</frameset>"; //End of HTML echo "</html>"; ----------------------------------------- Now we define the "mainframe.php" : require("test.php"); --------------------------------------- Let's define "test.php" : require_once("testclass.php"); if (!isset($dummy)){ $dummy = new testclass(); $dummy->attribut = "foo bar"; session_register("dummy"); } else{ echo $dummy->attribut; } --------------------------------------- When I refresh the mainframe it says : "fatal error : The script tried to execute a method or access a property of an incomplete object. Please ensure that class definition (...). The bug report #13298 give a walk arround : include the class definition before the session_start but I can't do it beceause I've to start my session in the frame-definition-page. I've to make an important presentation of our project in a few days and this problem is causing to me a lot of trouble... I need some help! Thx a lot! ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13869&edit=1

« previous php.dev (#71089) next »