Vhost time settings

Vhost time settings

am 26.06.2007 16:10:37 von gin

Hi, it's possible to set different time settings on an apache virtual host
than the rest of the system time
or other vhost time, so that a php script can see different time settings ?

Re: Vhost time settings

am 26.06.2007 17:18:25 von shimmyshack

On Jun 26, 3:10 pm, "Gin" wrote:
> Hi, it's possible to set different time settings on an apache virtual host
> than the rest of the system time
> or other vhost time, so that a php script can see different time settings ?

that kind of thing is best left to setlocale in the app layer, with
apache not AFAIK

Re: Vhost time settings

am 27.06.2007 15:24:22 von gin

> that kind of thing is best left to setlocale in the app layer

Can you explain a bit more about this ?

Re: Vhost time settings

am 27.06.2007 17:01:07 von shimmyshack

On Jun 27, 2:24 pm, "Gin" wrote:
> > that kind of thing is best left to setlocale in the app layer
>
> Can you explain a bit more about this ?

well the idea is simply to allow your users to control the locale that
gets used in your scripts, so that when they log on they see a time
appropriate to them because the script has detected their location
(remember their settings) and made a call to setlocale with their
language code.
If you could set the system time within a vhost section it would lead
to all kinds of weirdnesses, where one vhost was able to "cheat a php
script" which replied on system time to work - a trial script for
instance. And what would be the use of offsetting a system time for
one vhost, after all system time is what it is. What you are talking
about is "how can get php to see stuff" the answer is set it in the
config section that sets up the environment for each user when they
first log on.
Further exmples woulf include internationalisation, paths, font sizes,
data they saved, user tracking etc.. all require app level settings
and are thus easy to save to a database, easy to manipulate and set
per user, or per "site/vhost".
setlocale is documented in the manual and can be very useful indeed!

Re: Vhost time settings

am 27.06.2007 18:47:01 von gin

Thank you ! :-)

> well the idea is simply to allow your users to control the locale that
> gets used in your scripts, so that when they log on they see a time
> appropriate to them because the script has detected their location
> (remember their settings) and made a call to setlocale with their
> language code.
> If you could set the system time within a vhost section it would lead
> to all kinds of weirdnesses, where one vhost was able to "cheat a php
> script" which replied on system time to work - a trial script for
> instance. And what would be the use of offsetting a system time for
> one vhost, after all system time is what it is. What you are talking
> about is "how can get php to see stuff" the answer is set it in the
> config section that sets up the environment for each user when they
> first log on.
> Further exmples woulf include internationalisation, paths, font sizes,
> data they saved, user tracking etc.. all require app level settings
> and are thus easy to save to a database, easy to manipulate and set
> per user, or per "site/vhost".
> setlocale is documented in the manual and can be very useful indeed!
>