For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > December 2005 > Re: [PEAR] db_databobject session serialize









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] db_databobject session serialize
Justin Patrin

2005-12-16, 3:56 am

On 12/15/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
> I must be missing a file. Are these all I need to include prior to starti=

ng
> the session:
>
> require_once 'DB.php';
> require_once 'DB/DataObject/Generator.php';
> requre_once('DB/DataObject.php');
>
> I've even tried including:
>
> include_once('DB/pgsql.php');
> require_once 'DB/DataObject/Generator.php';
>
> as well.
>
> Any I'm missing?
>


Yep. You need to include the class files for the individual tables
that you serialized (put in a session) as well for this to work.

> Cheers,
>
> Benjamin Wragg
>
> "Justin Patrin" <papercrane@gmail.com> wrote in message
> news:432beae0512152141nee9a2u9bf7e120c38
e5a0f@mail.gmail.com...
> On 12/16/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
ect[color=darkred]
le[color=darkred]
t[color=darkred]
2 and[color=darkred]
>
> Nope, that's it.
>
> --
> Justin Patrin
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Justin Patrin
Benjamin Wragg

2005-12-16, 3:56 am

Like:

require_once 'DB/DataObject/Public_tablename.php';


I think I tried that; but I'm check it out again.

No other file you can think of that I need to include? I was just reading
the your post to Joseph Szobody's post about serializing a dataobject after
a find() you said:

Won't work. Doing a find only runs the query. If you don't pull the
record (fetch) then you'll lose the result when the script exits.
Store each of the fetched objects in an array and put that in a
session. Or refactor to not need it.

If I have done this could this be the reason why it isn't unserializing
nicely?

Cheers,

Benjamin


-----Original Message-----
From: Justin Patrin [mailto:papercrane@gmail.com]
Sent: Friday, 16 December 2005 5:12 PM
To: Benjamin Wragg
Cc: pear-general@lists.php.net
Subject: Re: [PEAR] db_databobject session serialize

On 12/15/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
> I must be missing a file. Are these all I need to include prior to
> starting the session:
>
> require_once 'DB.php';
> require_once 'DB/DataObject/Generator.php';
> requre_once('DB/DataObject.php');
>
> I've even tried including:
>
> include_once('DB/pgsql.php');
> require_once 'DB/DataObject/Generator.php';
>
> as well.
>
> Any I'm missing?
>


Yep. You need to include the class files for the individual tables that you
serialized (put in a session) as well for this to work.

> Cheers,
>
> Benjamin Wragg
>
> "Justin Patrin" <papercrane@gmail.com> wrote in message
> news:432beae0512152141nee9a2u9bf7e120c38
e5a0f@mail.gmail.com...
> On 12/16/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
>
> Nope, that's it.
>
> --
> Justin Patrin
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Justin Patrin



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005

Justin Patrin

2005-12-17, 3:58 am

On 12/15/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
> Like:
>
> require_once 'DB/DataObject/Public_tablename.php';
>
>
> I think I tried that; but I'm check it out again.
>
> No other file you can think of that I need to include?


Nope. As long as you include the file which defines the class of the
object you're unserializing you should be ok. You also need to include
any files for classes of objects the DB_DO may have inside it as well.

> I was just reading
> the your post to Joseph Szobody's post about serializing a dataobject aft=

er
> a find() you said:
>
> Won't work. Doing a find only runs the query. If you don't pull the
> record (fetch) then you'll lose the result when the script exits.
> Store each of the fetched objects in an array and put that in a
> session. Or refactor to not need it.
>
> If I have done this could this be the reason why it isn't unserializing
> nicely?
>


Shouldn't make a difference, but as I said it won't work as you think.
You can't fetch() on a freshly unserialized DO.

> Cheers,
>
> Benjamin
>
>
> -----Original Message-----
> From: Justin Patrin [mailto:papercrane@gmail.com]
> Sent: Friday, 16 December 2005 5:12 PM
> To: Benjamin Wragg
> Cc: pear-general@lists.php.net
> Subject: Re: [PEAR] db_databobject session serialize
>
> On 12/15/05, Benjamin Wragg <bwragg@tpg.com.au> wrote:
>
> Yep. You need to include the class files for the individual tables that y=

ou
> serialized (put in a session) as well for this to work.
>
=3D2[color=darkred]
>
>
> --
> Justin Patrin
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/20=

05
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/20=

05
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/20=

05
>
>
>



--
Justin Patrin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com