Re: DB_DataObject not creating tables

From: Date: Wed, 19 Jan 2005 18:19:06 +0000
Subject: Re: DB_DataObject not creating tables
References: 1 2 3 4 5 6 7  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17022@lists.php.net to get a copy of this message
On Wed, 19 Jan 2005 02:46:21 -0600, Larry Garfield <larry@garfieldtech.com> wrote: > Justin Patrin wrote: > > >>I presume that the problem is it can't write to a directory called -1 > >>(duh), and that it's getting the -1 from an error return value > >>somewhere. Beyond that, though, I'm not sure how to fix it. Any > >>suggestions? > > > > > > Where'd you put that define? It has to be before the require. You sure > > it's spelt right? I tend to mistype that define name... :-( > > Yep and yep. > > Copy and paste from the createTables.php script: > > define('DB_DATAOBJECT_NO_OVERLOAD',1); > > require_once 'DB/DataObject/Generator.php'; > > I'm thinking there's a different problem this time, but since I don't Oh yeah...what DB backend are you using? It may not work with some (SQLite, etc). Also, you can try putting PEAR::setErrorHandling(PEAR_ERROR_DIE) at the beginning to see where it's dying. Or: function pe($err) { die($err->getMessage().' '.$err->getUserInfo()); } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); for a more full error output. > know anything about the internals of DB_DataObject I can't be sure. > > > > > > >>-------------------------------- > >> > >>$ php4 createTables.php ../../../db_dataobject.ini > >> > >>db_dataobject_generator : 0 : CREATING FOR gmdarchive > >> > >>db_dataobject_generator : 0 : calling generatedefinitions > >>db_dataobject_generator : 0 : Generating Definitions file: > >> > >>Warning: Console_Getopt: unrecognized option -- 1 in > >>/usr/share/php/System.php on line 88 > >>db_dataobject_generator : 0 : Writing ini as -1/gmdarchive.ini > >> > >>Warning: touch(): Unable to create file -1/gmdarchive.ini because No > >>such file or directory in /usr/share/php/DB/DataObject/Generator.php on > >>line 248 > >> > >>Warning: fopen(-1/gmdarchive.ini): failed to open stream: No such file > >>or directory in /usr/share/php/DB/DataObject/Generator.php on line 250 > >> > >>Warning: fwrite(): supplied argument is not a valid stream resource in > >>/usr/share/php/DB/DataObject/Generator.php on line 251 > >> > >>Warning: fclose(): supplied argument is not a valid stream resource in > >>/usr/share/php/DB/DataObject/Generator.php on line 252 > >>db_dataobject_generator : 0 : calling generateclasses > >> > >>Warning: Console_Getopt: unrecognized option -- 1 in > >>/usr/share/php/System.php on line 88 > >>db_dataobject_generator : 0 : writing DataObjects_Fleets > >> > >>Warning: fopen(-1/Fleets.php): failed to open stream: No such file or > >>directory in /usr/share/php/DB/DataObject/Generator.php on line 464 > >> > >>Warning: fputs(): supplied argument is not a valid stream resource in > >>/usr/share/php/DB/DataObject/Generator.php on line 465 > >> > >>Warning: fclose(): supplied argument is not a valid stream resource in > >>/usr/share/php/DB/DataObject/Generator.php on line 466 > >>db_dataobject_generator : 0 : writing DataObjects_GM_Classifications > >> > >>-------------------------------- > >> > >>Justin Patrin wrote: > >> > >>>On Tue, 18 Jan 2005 03:55:38 -0600, Larry Garfield > >>><larry@garfieldtech.com> wrote: > >>> > >>> > >>>>Oh joy.... Does it affect only the createTables.php script, or will I > >>>>need to add that to any script that uses DB_DataObject subsequently? > >>> > >>> > >>>I always turn off overloading. It 1) breaks PHP 4.3.10, 2) has been > >>>known to cause crashes, and 3) (most important) breaks > >>>pass-by-reference in functions unless you use > >>>call-time-pass-by-reference in PHP4. This last is very very annoying > >>>and hard to track. I suggest turning off overloading in all of your > >>>DB_DataObject use. > >>> > >>> > >>> > >>>>Trevan wrote: > >>>> > >>>> > >>>>>PHP 4.3.10 has a problem with this. You might try adding adding > >>>>>define('DB_DATAOBJECT_NO_OVERLOAD',1); to the top, since that has > >>>>>helped > >>>>>some people, but for me, I had to change PHP back to 4.3.9, or get the > >>>>>latest snapshot for it to work. > >>>>> > >>>>>Trevan > >>>>> > >>>>>Larry Garfield wrote: > >>>>> > >>>>> > >>>>> > >>>>>>Greetings, all. I'm trying out DB_DatObject for the first time. > >>>>>>I've > >>>>>>read through the docs and followed the instructions listed, but > >>>>>>running into a problem. Specifically, when I try to run > >>>>>>createTables.php I get a function error. > >>>>>> > >>>>>>From the PEAR/DB/DataObject directory: > >>>>>> > >>>>>>$ php4 createTables.php ../../../db_dataobject.ini > >>>>>>db_dataobject_generator : 0 : CREATING FOR gmdarchive > >>>>>> > >>>>>>db_dataobject_generator : 0 : calling generatedefinitions > >>>>>> > >>>>>>Fatal error: Call to a member function on a non-object in > >>>>>>/usr/share/php/DB/DataObject/Generator.php on line 132 > >>>>>> > >>>>>>I checked, and line 132 of Generator.php is just a }. Thoughts on > >>>>>>what the problem could be? > >>>>>> > >>>>>>PHP Version: 4.3.10 > >>>>>>OS: Linux 2.6.10 > >>>>>>DB_DataObject version: 1.7.2 > >>>>>> > >>>>>>Any help greatly appreciated. > >>> > > -- Justin Patrin

« previous php.pear.general (#17022) next »