sharing information across requests

From: Antony Sequeira (usemyfullname_at_hotmail.com)
Date: 01/18/05


Date: Tue, 18 Jan 2005 02:11:56 GMT

Hi

I needed to share some configuration information across requests.
The most straightforward way would be code it in a php file and include it
in every other script.
The problem with this approach is, the configuration script is executed on
every request.
The configuration data once figured out by the script remains the same for a
host, but the script to figure out the data could be arbitrarily complex.
The only mechanism I have figured out so far is to use the
shm_attach ,shm_get_var etc functions to store a single php array with all
my config in sysv shared memory.
So, the code to figure out the config runs only once and then populates the
shared mem, after that in every request, the config is read from the shared
memory.

Is this the only way to do this stuff (the main reason for my posting here)
?
Essentially I am looking for something like a static member data in java
which would stay up as long as the class is loaded (which would be across
arbitrary number of requests). For example any java servlet class. The php
static stuff goes away after each request.
I was hoping that stuffing things into $_SERVER would retain things across
requests. No such luck.

Is there a better solution than the SysV shared mem api.
-Antony

P.S. I am using 4.3.4 apache 2.x and 1.x on linux (Fedora Core 3)



Relevant Pages

  • Re: Downgrading
    ... Requests for assistance by email can not and will not be acknowledged. ... and installed it today in a different folder on my Vista laptop. ... Utility to get rid of the Configuration screen that pops up every time ...
    (microsoft.public.office.misc)
  • Re: array.dll configuration script not downloading
    ... something wrong with the array because I can see the configuration file ... downloaded by the browser but after downloading ... the script the browser doesn't send a GET requests anywhere so perhaps ... there's something wrong with the script itself. ...
    (microsoft.public.isa)
  • Re: Tomcat 5 with IIS6 using JK2
    ... where it can corrupt the data in large HTTP POST requests. ... > guide but unfortunately the URL links in the PDF don't work for me so I ... in this configuration the shared memory is explicitly set ...
    (comp.lang.java.programmer)
  • Re: Tomcat 5 with IIS6 using JK2
    ... where it can corrupt the data in large HTTP POST requests. ... > guide but unfortunately the URL links in the PDF don't work for me so I ... in this configuration the shared memory is explicitly set ...
    (microsoft.public.inetserver.iis)
  • Re: sharing information across requests
    ... Can you serialize the configuration data into a database or text file? ... > I needed to share some configuration information across requests. ... > in every other script. ...
    (comp.lang.php)