Hi!

Yeah I know, but as I wrote below then I would need to put the complete file
library into each users session, which first blows that up considerably, and
scond probably is also slower as it is still read by each single script from
hard disk (session data file) and the objects are recreated ... what I'm
looking for is a superglobal which is actually never destroyed until the
server is shut down ... one that is in memory until I explicitely destroy it
... and that is available to each script that is run without the need to
create a copy each time ...

 mathias rockel

----- Original Message -----
From: "Jason Sheets" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:26 PM
Subject: Re: [PHP] Persistent global data ?


> Take a look at sessions, $_SESSION is already a super global.
>
> If you want to store an object I believe you have to serialize() it
> first.
>
> Jason
>
>
> On Tue, 2003-01-14 at 06:33, Mathias Rockel wrote:
> > Hi all !
> >
> > I am currently writing some kind of Document/File-Library in a LAMP
> > environment.
> >
> > As the library should be able to handle various file types, and most
file
> > types have to be handled differently internally, I would like to use
> > Objects/Classes to make the code for the Library iself independent from
the
> > stuff that is individual to the different file types.
> >
> > Now I noticed early that when I use Objects in PHP and have to create
many
> > for them each time a script runs it slows the system down considerably.
It
> > seems you can now save objects in sessions which AFAIR was not possible
last
> > time I tried. But then I would have to read the whole file index (which
is
> > actually a tree) into a session variable for each user, and I don't know
if
> > thats a good idea performancewise. It would be a rather large
> > multi-dimensional array.
> >
> > So I would like to know if there is any possibility in PHP to create my
own
> > persistent superglobal, a variable which can be read by any script
running.
> > I think something similiar is available as the "Application" Object in
ASP
> > under IIS. I know I have to take care of locking and stuff (although the
> > end-user scripts would only need read access to it), but if I could
write
> > some functions which just would check if the tree is already in memory
or
> > not (after a server shutdown or whatever), and if not just read it in
from
> > the database to make it available in every other script.
> >
> > The only thing I've found so far which I think may be a possibility is
the
> > shared memory stuff that PHP supports, but I don't know anything about
that
> > on the system level, and its not explained in much detail in the PHP
manual.
> > Is that something I should follow, or can't I use it ? Can I somehow use
the
> > underlying Apache ? Are there better options ?
> >
> > any help/suggestions/hints are greatly appreciated !
> >
> > mathias rockel
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to