Re: Issues using MDB2 with the DataObject cvs, possible MDB2 problem :)
| From: | Justin Patrin | Date: | Mon, 30 May 2005 04:33:21 +0000 |
| Subject: | Re: Issues using MDB2 with the DataObject cvs, possible MDB2 problem :) | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19409@lists.php.net to get a copy of this message | ||
On 5/29/05, Dan Rossi <pear@electroteque.org> wrote:
> Hi there, some issues have arisen upgrading my MDB2 package. It has
> been working fine, I reverted my hacked up DataObject back to cvs so I
> can start making diffs from some of the changes, so its not that :) It
> only happens when I try and set the debug setting to on
>
> MDB2 Error: not supported __sleep : method not supported.
>
>
> The issue throwing the error is line 2137 of DataObject
> The issue has arisen in line 1573 of MDB2 in the __call method..
>
> if (is_null($module)) {
> ..
> ...
> ...
>
> }
>
> This however doesnt happen using DB. It looks like __call is trying to
> call a __sleep module or something ?
This is because the debug methods serialize the result object (and
maybe the DB object as well), which calls __sleep. IMHO this really
shouldn't be done on live objects for this exact reason. Look for
__sleep methods in MDB2 or remove the serialize calls from DO's debug
calls.
> My other issue is reverting back
> to DO, another problem has arisen where I was sending the db_options
> from a nested array of the DO settings. I have attempted to set it as a
> staticproperty of $db_options within the constructor of my class where
> I have setup the DO config, however its still not being sent or loaded
> to $db_options within the DO.
>
> I set it like this
>
> $db_options = PEAR::getStaticProperty('MDB2','options');
You need a & above otherwise you're just setting the same variable to
two different copies.
$db_options =& PEAR::getStaticProperty('MDB2','options');
> $db_options = $this->settings['DB_DataObject']['MDB2'];
No & here, though, or it won't work.
>
> Any ideas ?
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Justin Patrin