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-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 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: $c->res

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(); > >

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.p

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 Octavian Rasnita
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): sub the_host { my ($c) = @_; return $c->req->host

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

Re: [Catalyst] hostname

2008-01-10 Thread Ash Berlin
On Jan 10, 2008, at 6: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

Re: [Catalyst] hostname

2008-01-10 Thread Wade . Stuart
"Octavian Rasnita" <[EMAIL PROTECTED]> wrote on 01/10/2008 12:54:06 PM: > 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 d

Re: [Catalyst] hostname

2008-01-10 Thread Octavian Rasnita
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 if a $c variable is not available? Octavian __

Re: [Catalyst] hostname

2008-01-10 Thread Carl Johnstone
From: <[EMAIL PROTECTED]> How would you propose handling an ASP like service that is branded (both host whatever.companya.com ... othersuch.company9.com, and templates) for 1 companies? You should've a bit further down to where I wrote: That said, there's a case for needing to know t

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

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 o

Re: [Catalyst] hostname

2008-01-09 Thread Wade . Stuart
"Octavian Rasnita" <[EMAIL PROTECTED]> wrote on 01/09/2008 02:01:02 PM: > From: <[EMAIL PROTECTED]> > > So if you want the cookie to be set on the client without worrying about > > the hostname requested don't set the domain_name or set the domain_name to > > the common domain for all hosts. > > T

Re: [Catalyst] hostname

2008-01-09 Thread Octavian Rasnita
From: <[EMAIL PROTECTED]> So if you want the cookie to be set on the client without worrying about the hostname requested don't set the domain_name or set the domain_name to the common domain for all hosts. Thank you very much! That was it. I thought that if I won't set a domain name, it wont s

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 objec

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 differ

Re: [Catalyst] hostname

2008-01-09 Thread Ash Berlin
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 MyApp.pm? Thanks. Octavian Currently MyApp.pm *is* the context ob

Re: [Catalyst] hostname

2008-01-09 Thread Octavian Rasnita
From: 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. I want to use the current hostname

Re: [Catalyst] hostname

2008-01-09 Thread Octavian Rasnita
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 MyApp.pm? Thanks. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http

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 pos

Re: [Catalyst] hostname

2008-01-08 Thread Ashley
Oh, I was too fast. Blush. You mean without the context object. :( On Jan 8, 2008, at 11:31 PM, Octavian Rasnita wrote: Hi, Is it possible to get the host name in MyApp.pm just like I can do it in a controller using $c->req->hostname; Thank you. Octavian ___

Re: [Catalyst] hostname

2008-01-08 Thread Ashley
Will I win this game of slapjack? $c->request->uri->host On Jan 8, 2008, at 11:31 PM, Octavian Rasnita wrote: Hi, Is it possible to get the host name in MyApp.pm just like I can do it in a controller using $c->req->hostname; Thank you. Octavian

[Catalyst] hostname

2008-01-08 Thread Octavian Rasnita
Hi, Is it possible to get the host name in MyApp.pm just like I can do it in a controller using $c->req->hostname; Thank you. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searc