-- Ian Warner <[EMAIL PROTECTED]> wrote
(on Tuesday, 17 April 2007, 10:51 PM +0100):
> Alex Netkachov wrote:
> > I believe you need to use either $config-> db-> __set('dbname',
> > 'somename'); or $config-> db-> dbname = 'somename'; but not
> > $config-> __set('db.host', ' 127.0.0.1 <http://127.0.0.1> ');
> >
> > Sincerely,
>
> Alex
>
> Spot on my friend, thank you very much.
>
> Should include this little snippet in the docs or wtihin the code block
As a general rule, __get() and __set() are not meant to be called
directly; they're primary purpose is to allow access to 'virtual'
properties. I don't think there's any need to document anything but the
intended usage.
> > On 4/17/07, *Ian Warner* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]> > wrote:
> >
> > I have the following code
> >
> > Allow modifications is set to on so should be ok.
> >
> > But the SET does not seem to be working.
> >
> > Maybe cause what I need to set is an array?
> >
> >
> > // Loop through the databases
> > foreach ($databases as $k => $v) {
> >
> > $config-> __set(' db.dbname', $v['Database']);
> >
> > $db = Zend_Db::factory($config-> db_adapter,
> > $config-> db-> asArray());
> >
> > Zend_Debug::dump($config-> db, 'Config', true);
> >
> > // Query to retrieve the tables within the database
> > $sql = $db-> query('SHOW TABLES');
> > $tables = $sql-> fetchAll();
> >
> > Zend_Debug::dump($tables, 'Tables', false);
> > }
> >
> > db.host = localhost
> > db.username = root
> > db.password =
> > db.dbname = admin
> > db.profiler = true
> > db.useSQL = false
> > db_adapter = PDO_MYSQL
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/