"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 during a request in MyApp.pm if a $c
> variable is not available?
>
> Octavian
>

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 set it at that point at
all?  I would still opt for using the request to set a dynamic hostname
later in the process unless you have good reason not to (ssl cert tied to a
hostname for example).  I think most times it is better to not assume that
the hostname requested will be static in code. It makes for a more flexible
and  deployment easier for your app (do you really want to go change a
hardcoded hostname when dns changes need to happen).




-Wade







_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to