Re: DataObject and Username
| From: | Alex Goddard | Date: | Thu, 19 Aug 2004 14:13:27 +0000 |
| Subject: | Re: DataObject and Username | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14185@lists.php.net to get a copy of this message | ||
On Wed, 18 Aug 2004, Norbert Mocsnik wrote:
> Alex Goddard wrote:
> > Hi,
> >
> > I'm looking for a way to, if a configuration option is set, connect to a
> > database using my own username and password instead of the ones given in
> > the 'database' option of DB_DataObject.
> [snip]
>
> Instead of using ini-files, set up an array.
>
> See the _second part_ of Example 26-2. Setting the default options.
>
> http://pear.php.net/manual/en/package.database.db-dataobject.intro-configuration.php
>
> $options = &PEAR::getStaticProperty('DB_DataObject','options');
> $options = array(
> 'database' => 'mysql://user:password@localhost/vending',
> 'schema_location' => '/home/me/Projects/myapplication/DataObjects',
> 'class_location' => '/home/me/Projects/myapplication/DataObjects',
> 'require_prefix' => 'DataObjects/',
> 'class_prefix' => 'DataObjects_',
> );
>
> I generally dislike .ini files--I always use it this way so I can
> guarantee it works.
This seems like the way to go. Thanks for the help to the two who
replied.
--
Alex Goddard
agoddard@cerias.purdue.edu