RE: [PEAR] DataObject find() error

From: Date: Thu, 12 Dec 2002 18:18:34 +0000
Subject: RE: [PEAR] DataObject find() error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2961@lists.php.net to get a copy of this message
> -----Original Message----- > From: LIMBOURG Arnaud [mailto:arnaud.limbourg@cegetel.fr] > > > > > I've got a little further now - I'm setting up my instance of a > > DataObject inside a class method I've written: > > > > function listMembers($contractedId = -1) { > > if($contractedId == -1) { > > return false; > > } > > > > $options = > > &PEAR::getStaticProperty('DB_DataObject','options'); > > $config = parse_ini_file('redbox_databases.ini', TRUE); > > $options = $config['DB_DataObject']; > > unset($options); > > Why do you unset $options ??????? In an off-list email, Stijn de Reede suggested: /* imho it is safest to unset the reference, so that if you assign someting else to $options, it won't change the PEAR property */ unset($options); I was / am confused!! I removed it but still get the same error, "Unable to include the DB/.php file for `'" > DataObjects needs it, the DSN is in there, that's why you get > the error ;)) > > Plus, do a > > function &listMembers($contractedId = -1) { > > Because you want a reference returned by the method and not a copy :) Yeah ... Sure I'll do that, but for now I just wanted to var_dump() the output somewhere :) > With that it'll work. No luck sadly :-( It's starting to make me wonder if using DataObjects was actually a good idea for this project, it is already behind schedule :) - Mike Carter

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