__PHP_Incomplete_Class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

__PHP_Incomplete_Class

Post by Shendemiar »

There's not much info about the previous.

It happens at least when you store class to session.

Under some circumstances the class is stored ok.

Then again, on some others it's still stored ok, but when displaying the session by var_export, it still has the class info, but it says also __PHP_Incomplete_Class.

Currently i'm having a fully ok class in my session, and also a incomplete class. And the actual session file shows both classes completely the same way. How does it know if the other is'nt "complete" class?

Can anyone say anything about this.

Code: Select all

array ( 'logged' => 'true', 'user' => class cUser { public $UserID = '1'; public $Username = 'Shendemiar'; public $Administrator = '1'; public $Visits = '0'; public $EmailAddress = 'something here'; }, 'battle' => class __PHP_Incomplete_Class { public $__PHP_Incomplete_Class_Name = 'cBattle'; public $ID = '1'; public $Number = '1'; public $Name = 'Battle of the Plains'; public $Turn = '0'; public $Scenario = '1'; public $Ruleset = '1'; public $Created = '2004-11-28'; public $Expires = '2005-11-28'; public $Status = '0'; public $Number_of_Sides = '2'; public $Player_ID = array ( 1 => '1', 2 => '2', ); public $Player_Name = array ( 1 => 'Shendemiar', 2 => 'name2', ); public $Leader_Names = array ( 1 => 'Luxor the Moonprince', 2 => 'Timoshenko', ); public $Side_Names = array ( 1 => 'People of Midnight', 2 => 'Soviet Army', ); public $Player_Names_Visible = '1'; public $Side_Playthis = array ( 1 => 1101732143, ); }, )
the user-cUser is ok while the battle-cBattle isnt.

Session file looks like this:

Code: Select all

logged|s:4:"true";user|O:5:"cUser":5:{s:6:"UserID";s:1:"1";s:8:"Username";s:10:"Shendemiar";s:13:"Administrator";s:1:"1";s:6:"Visits";s:1:"0";s:12:"EmailAddress";s:26:"email here";}battle|O:7:"cBattle":16:{s:2:"ID";s:1:"1";s:6:"Number";s:1:"1";s:4:"Name";s:20:"Battle of the Plains";s:4:"Turn";s:1:"0";s:8:"Scenario";s:1:"1";s:7:"Ruleset";s:1:"1";s:7:"Created";s:10:"2004-11-28";s:7:"Expires";s:10:"2005-11-28";s:6:"Status";s:1:"0";s:15:"Number_of_Sides";s:1:"2";s:9:"Player_ID";a:2:{i:1;s:1:"1";i:2;s:1:"2";}s:11:"Player_Name";a:2:{i:1;s:10:"Shendemiar";i:2;s:9:"name2";}s:12:"Leader_Names";a:2:{i:1;s:20:"Luxor the Moonprince";i:2;s:10:"Timoshenko";}s:10:"Side_Names";a:2:{i:1;s:18:"People of Midnight";i:2;s:11:"Soviet Army";}s:20:"Player_Names_Visible";s:1:"1";s:13:"Side_Playthis";a:1:{i:1;i:1101732143;}}
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

could you give some background on what you're trying to achieve?

Your post is a bit like going to a restaurant and telling the waiter: "I would like some food." - in short: very unspecific.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

True, but that's the case from my viewppoint.

I'm rather after "what is it?", "why does it show?", than "make my code work"

It shows nothing on the errorfile either....
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

if you don't know what you want to achieve, how could anyone else help you with it?
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

If i wasnt clear:

I want anyone who knows anything about this to say anythign.

Not out of curiosity but out of exeperience.

Tomorrow i'll take a serious look myself into this.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You get "__PHP_Incomplete_Class" when you have not included the class definition before the session is started with a serialized instance of the class saved in the session.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

That seems to be the case. Thanks for your help.
Post Reply