Re: [Catalyst] hostname

2008-01-11 Thread Knut-Olav Hoven
On Thursday 10 January 2008 21:15:25 Octavian Rasnita wrote: From: Ash Berlin [EMAIL PROTECTED] How did you get to a function in MyApp.pm during a request # in MyApp.pm sub foobarbaz { my ($c) = @_; } # In controller code. $c-foobarbaz(); Make sense? Not really.

Re: [Catalyst] hostname

2008-01-11 Thread Carl Johnstone
cookie_domain = the_host() in the MyApp config, but when I try to start the server it gives an error telling that I can't use the method req because $c is undefined. I'd be curious about why you wanted the cookie domain in the config anyway! I presume you've got a bit of code like:

Re: [Catalyst] hostname

2008-01-11 Thread Octavian Rasnita
From: Carl Johnstone [EMAIL PROTECTED] cookie_domain = the_host() in the MyApp config, but when I try to start the server it gives an error telling that I can't use the method req because $c is undefined. I'd be curious about why you wanted the cookie domain in the config anyway! I

Re: [Catalyst] hostname

2008-01-11 Thread Jason Kohles
On Jan 11, 2008, at 5:29 AM, Carl Johnstone wrote: cookie_domain = the_host() in the MyApp config, but when I try to start the server it gives an error telling that I can't use the method req because $c is undefined. I'd be curious about why you wanted the cookie domain in the config

Re: [Catalyst] hostname

2008-01-10 Thread Carl Johnstone
from the context object, but is unavailable to MyApp.pm. cookie_domain Both the context object and the hostname should be available to code within MyApp.pm, but only if the code is running during a request. In any case I wouldn't point multiple domains at the same site, you're always best

Re: [Catalyst] hostname

2008-01-10 Thread Wade . Stuart
Carl Johnstone [EMAIL PROTECTED] wrote on 01/10/2008 09:44:30 AM: from the context object, but is unavailable to MyApp.pm. cookie_domain Both the context object and the hostname should be available to code within MyApp.pm, but only if the code is running during a request. In any case I

Re: [Catalyst] hostname

2008-01-10 Thread Jason Kohles
On Jan 10, 2008, at 1:54 PM, Octavian Rasnita wrote: From: Carl Johnstone [EMAIL PROTECTED] Both the context object and the hostname should be available to code within MyApp.pm, but only if the code is running during a request. Ok, but how to get the hostname during a request in MyApp.pm

Re: [Catalyst] hostname

2008-01-10 Thread Octavian Rasnita
From: [EMAIL PROTECTED] Sys::Hostname or a statically set config var, as there is no reference to a request at that point (or any real way to derive the list of possible hostnames hat could be requested). But then again, unless you know the hostname that will always be requested why try to

Re: [Catalyst] hostname

2008-01-10 Thread Jason Kohles
On Jan 10, 2008, at 3:15 PM, Octavian Rasnita wrote: From: Ash Berlin [EMAIL PROTECTED] How did you get to a function in MyApp.pm during a request # in MyApp.pm sub foobarbaz { my ($c) = @_; } # In controller code. $c-foobarbaz(); Make sense? Not really. I've tried (in MyApp.pm):

Re: [Catalyst] hostname

2008-01-09 Thread Jason Kohles
On Jan 9, 2008, at 6:16 AM, Octavian Rasnita wrote: Is it possible to get the host name in MyApp.pm just like I can do it in a controller using $c-req-hostname; I want to use the current hostname for setting the cookie in the session, and the site could be accessed with 2 or more

Re: [Catalyst] hostname

2008-01-09 Thread Wade . Stuart
Ash Berlin [EMAIL PROTECTED] wrote on 01/09/2008 05:39:22 AM: On Jan 9, 2008, at 11:12 AM, Octavian Rasnita wrote: From: Ashley [EMAIL PROTECTED] Oh, I was too fast. Blush. You mean without the context object. :( Yes, that's what I want. Can't the context object be accessed in

Re: [Catalyst] hostname

2008-01-08 Thread Oleg Pronin
If you mean to get hostname in offline mode (off the processing request) - the hostname is not known because there are no request. You can get the server's real hostname by Sys::Hostname::hostname() but this probably won't help. 2008/1/9, Octavian Rasnita [EMAIL PROTECTED]: Hi, Is it possible