Re: where do you store app wide data?

From: worzel (asda_at_sdarta.com)
Date: 01/02/05


Date: Sun, 2 Jan 2005 10:47:13 +0800

Thanks Tommy - thats pretty much the answer I didn't want! But,
unfortunately, it seems to be the accurate one.

I guess I have been spoiled in this respect as CF and Java both let me do
this without even a second thought - PHP is making it a bit of an effort. I
think I will just stick with a file read/write for the simpler cases (off I
go now to learn more about locking issues in PHP) and perhaps look into some
DB mapping solutions that may allow me to map and unmap arrays and objects
into to and from database - I think serialiszing may be my next port of call
afater file locking. (Again, spoiled, used to Hibernate for this stuff)

Any pointers, other than the docs, in either of these areas would be useful?
Though I guess they may be 2 separate posts later if I dont get anywhere
fast on my own!

Cheers.

Andy

"Tommy Gildseth" <gildseth@start.no> wrote in message
news:cr7jr0$kfm$1@news.tdcnorge.no...
> worzel wrote:
>
>> In Java, there is an ServletContext object for storing app wide data. And
>> in coldfusion there is an 'application' scope. How is this done in PHP? I
>> know I could use a database or even a file, but this seems a bit much
>> trouble in the basic cases and lacking in the more complex cases. (ie;
>> storing entire objects or arrays etc).
>
> I'm a bit stumped at how so many can missunderstand this question, and
> suggest stuff like $_SESSION and whatnot, but the fact is, that PHP does
> not have support for application wide variables, or server variables if
> you
> like.
> It is however possible to do, and it's not all that hard to create your
> own
> library functions for doing something like this.
> The Shared memory functions (http://no2.php.net/shmop) is one option, if
> you
> want to implement something like this.
>
> --
> Tommy
>



Relevant Pages

  • Re: [PHP] : Who is there ?
    ... > What you need to do is to log the information with help of PHP to a file, ... > there are three $_SERVER variables that can give you some info and they are ... Pourquoi les établissements ouverts 24 heures sur 24 ont-ils des ...
    (alt.php)
  • Re: How to get the document root (public html folder)?
    ... > You must have something wrong with your server setup because I am running ... > PHP on Windows XP and all the $_SERVER variables are there. ... > running Apache, not IIS, so the fault must be with IIS. ... I believe you need to have PHP as Apache module to get the DOCUMENT_ROOT ...
    (comp.lang.php)
  • Re: Apache 2.0.54, Windows 2k, and php5.0.5 - do the work together
    ... > PHP and HTML ... > Server Variables ... Prev by Date: ...
    (comp.lang.php)
  • Re: where do you store app wide data?
    ... How is this done in PHP? ... > know I could use a database or even a file, but this seems a bit much ... not have support for application wide variables, or server variables if you ... The Shared memory functions is one option, ...
    (alt.php)
  • Re: where do you store app wide data?
    ... I spent some time in CF doing Application scope ... Welcome to PHP. ... > afater file locking. ... >>not have support for application wide variables, or server variables if ...
    (alt.php)