Re: Get current database host?

2009-07-21 Thread toby1kenobi

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?

2009-07-21 Thread Dr. Loboto

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?

2009-07-21 Thread Piotr Kilczuk

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?

2009-07-21 Thread toby1kenobi

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
-~--~~~~--~~--~--~---