Page 1 of 1

something like Application

Posted: Wed Jan 10, 2007 1:45 am
by nitinjavakid
Is there something in php which is similar to Application in ASP?

Posted: Wed Jan 10, 2007 2:25 am
by Chris Corbyn
Sessions, combined with a database. In short - no there isn't, but you can recreate the same sort of thing.

Posted: Wed Jan 10, 2007 3:56 am
by dibyendrah
What does Application in ASP do ?

Posted: Wed Jan 10, 2007 4:03 am
by onion2k
dibyendrah wrote:What does Application in ASP do ?
It's a container for application wide data. Imagine you have 100 people using an app, Application would be used for data that's shared between all of them such as counters, locks, maybe even database connections (though that would be better handled by a proper connection pool).

Posted: Wed Jan 10, 2007 4:35 am
by _ca_
onion2k wrote:It's a container for application wide data.
You can use a shared memory in PHP: http://php.net/manual/de/ref.sem.php

Posted: Wed Jan 10, 2007 4:47 am
by Kieran Huggins
You could use a database, but you wouldn't be able to store a DB connection in one.

Posted: Wed Jan 10, 2007 5:16 am
by nitinjavakid
thanks

Posted: Wed Jan 10, 2007 6:34 am
by onion2k
If you're using a database you'd be best off using a heap table. The main thing about Application data is making sure users affecting the stored variables don't mess with one another, so it needs to be fast. All the data in a heap is lost on a reboot, but that's the same as Application data under IIS anyway so it'd be more 'realistic'.

Posted: Thu Jan 11, 2007 1:08 am
by dibyendrah
Heap table is new to me. Will you please give a brief on implementing heap table using php ?

Posted: Thu Jan 11, 2007 1:17 am
by Christopher
nitinjavakid wrote:thanks
The answer is that you could certainly make something that does that ... but that is not the shared-nothing way of PHP. Use .NET if you like/need something like that.

Posted: Thu Jan 11, 2007 1:32 am
by feyd
dibyendrah wrote:Heap table is new to me. Will you please give a brief on implementing heap table using php ?
Instead of the default storage engine you specify HEAP or MEMORY during table creation. That's it.