Re: Can't set DB_DataObject_FormBuilder options in DataObject.ini.

From: Date: Mon, 25 Jul 2005 16:31:43 +0000
Subject: Re: Can't set DB_DataObject_FormBuilder options in DataObject.ini.
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20126@lists.php.net to get a copy of this message
On 7/24/05, jp <newsletters@sizwe.org> wrote: > I am having trouble getting DB_DataObject_FormBuilder to read the options set > in DataObject.ini. I include the following file, config.php, in all files > that use DataObject_FormBuilder: > > <?php > // this is the common configuration code - place in a general site wide > include file. > // the simple examples use parse_ini_file, which is fast and efficient. > // however you could as easily use wddx, xml or your own configuration array. > $ini_config = parse_ini_file('../includes/DataObject.ini',TRUE); > > // this the code used to load and store DataObjects Configuration. > $options = &PEAR::getStaticProperty('DB_DataObject','options'); > > // because PEAR::getstaticProperty was called with and & (get by reference) > // this will actually set the variable inside that method (a quasi static > variable) > $options = $ini_config['DB_DataObject']; The problem is that you're not setting the formbuilder options at all. You're only setting the DB_DataObject options. If you use the DB_DataObject documentation the Configuration section gives the correct way to set the options from the ini file. http://pear.php.net/manual/en/package.database.db-dataobject.intro-configuration.php > > // set FormBuilder options -- commented out as per changelog for > DataObject_FormBuilder 0.17.2 > //$_DB_DATAOBJECT_FORMBUILDER['CONFIG'] = > $ini_config['DB_DataObject_FormBuilder']; This line is no longer needed. Please see the recent changelog entries. -- Justin Patrin

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