ID: 13869
Updated by: hholzgra
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: Session related
Operating System: Linux Red-Hat 7.1
PHP Version: 4.0.6
New Comment:

changed to feedback status


Previous Comments:
------------------------------------------------------------------------

[2001-10-30 08:04:01] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to