Hi there,
Anyone actually using persistent objects in PHP application. I personally thing this is a rather slow process and don't see much benefits.
Are you storing it in $_SESSION or database?
Anyone using persistent object in PHP. for what?
Moderator: General Moderators
Can you point a few things you use them for. Is it faster if using them. What is the advantage?feyd wrote:yes I use them for a lot of things. However, if they are only use specific objects end up in the session data. Everything else is tossed into shared memory. In any given page, I can have as many as 5000 objects floating around pretty easily.
" However, if they are only use specific objects end up in the session data. Everything else is tossed into shared memory." - didnt quite get what you mean
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
It's not for speed but efficiency and ease of working with it. Each object understands its data so each object knows how to pack itself into the session or shared memory and unpack itself when needed again.jmut wrote:Can you point a few things you use them for. Is it faster if using them. What is the advantage?
Sorry, user specific objects reside in session data but many objects aren't user specific. For those, I throw them into shared memory so that all users have access to it. For instance, the main database interaction object is a global object for the record set it generates when a select query is performed is user (page) specific. If this data should be carried over to other pages, it will be kept in their session while the database object remains in shared memory. The application controller and configuration object resides in shared memory as well while the user's details are kept in their session.jmut wrote:" However, if they are only use specific objects end up in the session data. Everything else is tossed into shared memory." - didnt quite get what you mean
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
So feyd, you are using these http://php.net/shmop
functions to store in shared memory? Did I get this right?
functions to store in shared memory? Did I get this right?