Re: Get current database host?
Great, thanks Piotr and Dr, that was what I was after! Toby On Jul 21, 3:37 pm, "Dr. Loboto" wrote: > In model: $this->getDataSource()->config['host'] > > On Jul 21, 7:15 pm, toby1kenobi wrote: > > > Hi there, > > > Is is possible to read the current database host programmatically > > (i.e. the value of $default['host'] from database.php)? > > > Thanks, > > > Toby > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Get current database host?
In model: $this->getDataSource()->config['host'] On Jul 21, 7:15 pm, toby1kenobi wrote: > Hi there, > > Is is possible to read the current database host programmatically > (i.e. the value of $default['host'] from database.php)? > > Thanks, > > Toby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Get current database host?
Hello, > Is is possible to read the current database host programmatically > (i.e. the value of $default['host'] from database.php)? Why not just use DATABASE_CONFIG::$default ? :) However, each Model instance will have the following method: http://api.cakephp.org/class/model#method-ModelgetDataSource which should be better for you. I didn't use that yet, though. Regards, Piotr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Get current database host?
Hi there, Is is possible to read the current database host programmatically (i.e. the value of $default['host'] from database.php)? Thanks, Toby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---