RE: [PEAR] DB_DataObject_FormBuilder steps
| From: | Mike Carter | Date: | Fri, 29 Aug 2003 10:20:57 +0000 |
| Subject: | RE: [PEAR] DB_DataObject_FormBuilder steps | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7464@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jason [mailto:okitek@kda.attmil.ne.jp]
>
> And get this error
>
> Fatal error: Cannot instantiate non-existent class:
> dataobjects_prob in
> /usr/local/www/data-dist/peartest/create/fb.php on line 2
>
> Then I added to fp.php
> require '/usr/local/lib/php/DB/DataObject/Prob.php';
> require '/usr/local/lib/php/DB/DataObject/FormBuilder.php';
>
> and get this error
>
> DB Error: not found
I've not used the FormBuilder package as it arrived after I'd already
got knee deep in stuff. However...
Are you loading your dataobjects configuration in before trying to
connect to the dbase?
What I do (not sure if this is the recommend way to use DO) is to make
all the auto generated classes subclass from a master dataobject class.
This class has just a constructor in it which will load in my
dataobjects configuration file so that all other dataobjects know the
dbase connection parameters etc.
require_once 'DB/DataObject.php';
class DataObjects extends DB_DataObject{
/*
Constructor
*/
function DataObjects() {
$options =
&PEAR::getStaticProperty('DB_DataObject','options');
$config =
parse_ini_file('Etc/DataObject/DataObject.ini.php',TRUE);
$options = $config['DB_DataObject'];
}
}
Apart from the above, not sure whatelse it could be :o)
Regards,
Mike C.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________