Re: Application Scope variables ?
From: Tony Marston (tony_at_NOSPAM.demon.co.uk)
Date: 09/23/04
- Next message: Tony Marston: "Re: Opinions? Is it _GOOD_ that foreach() throws warning when given undef var?"
- Previous message: Zurab Davitiani: "Re: Opinions? Is it _GOOD_ that foreach() throws warning when given undef var?"
- In reply to: aa: "Re: Application Scope variables ?"
- Next in thread: Simon Stienen: "Re: Application Scope variables ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Sep 2004 18:49:53 +0100
"aa" <aa@virgin.net> wrote in message
news:4152a0a2$0$17948$ed2619ec@ptn-nntp-reader02.plus.net...
> In ASP an application is an object created when a first request is made to
> a
> website. This object seats in the memory and contains methods and
> properties
> some of the properties can be created and modified from ASP code.
> As a websever can serve more them one website and some websites might be
> visited just several times a day, there is little point to keep all these
> website objects in the memory all the time. For that purpose, if a website
> does not receive requests for certain time (which can be preset on the
> websrver), the Application object is destroyed and memory reclaimed. Not
> to
> loose data stored in the Object, it allows to write this data onto disk
> before being destroyed.
> If I understand correctly, PHP does not maintain such an object and the
> variables relevant to the whole website need to be written onto disk
> before
> a relevant session expires.
Correct. PHP does not understand the concept of "application" as you
describe it.
>From your description it seems to be more of a function of the web server as
only the web server can create the object on the first request, and destroy
the object if there have not been any requests for a period of time.
If you want to emulate this with PHP you must read in the variables with
every request and write out any changes before the script dies. You can use
session files or database tables. It may be possible to use data in shared
memory, but you would have to write your own routines for loading it and
destroying it. Personally I wouldn't bother as the overhead of reading in
data with every request is so small that it's not worth the effort to
replace it with something more flashy.
-- Tony Marston http://www.tonymarston.net
- Next message: Tony Marston: "Re: Opinions? Is it _GOOD_ that foreach() throws warning when given undef var?"
- Previous message: Zurab Davitiani: "Re: Opinions? Is it _GOOD_ that foreach() throws warning when given undef var?"
- In reply to: aa: "Re: Application Scope variables ?"
- Next in thread: Simon Stienen: "Re: Application Scope variables ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|