Re: Update dsn for DataObjects

From: Date: Thu, 10 Apr 2003 20:44:09 +0000
Subject: Re: Update dsn for DataObjects
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4786@lists.php.net to get a copy of this message
Peter Meth wrote:
Where is the database info (dsn I assume) stored for DataObjects, and how do I change it? I have looked through the files and I cannot figure out how it is done. Any help would be appreciated. Thanks Peter Hello,
when you setup DataObjects , you first have to fill a config.ini file where you set a DB_DATAOBJECTS section , the first line is for your dsn ---------------------------------------------------- myapp.ini [DB_DataObject]
database        = mysql://login:pass@localhost/DB
schema_location = /where/your/schema/is class_location = /where/your/class/are require_prefix = DataObjects/
class_prefix    = DataObjects_
;seq_tablename = __IGNORE__ ignore_sequence_keys = tj_pro_mag,tj_sta_pro debug = 0 debug_ignore_updates = 0 production = 0 ------------------------------------------------- Then, you can generate DataObjects class and files with a php generateTables.php myapp.ini And in your script, you can include a config load like: $config = parse_ini_file('myapp.ini',TRUE); foreach($config as $class=>$values) { $options = &PEAR::getStaticProperty($class,'options'); $options = $values; } Hope it helps regards -- Xavier

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