something like Application

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nitinjavakid
Forum Newbie
Posts: 3
Joined: Tue Jan 09, 2007 11:45 am

something like Application

Post by nitinjavakid »

Is there something in php which is similar to Application in ASP?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Sessions, combined with a database. In short - no there isn't, but you can recreate the same sort of thing.
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

What does Application in ASP do ?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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).
_ca_
Forum Newbie
Posts: 12
Joined: Wed Oct 25, 2006 4:38 pm

Post 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
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

You could use a database, but you wouldn't be able to store a DB connection in one.
nitinjavakid
Forum Newbie
Posts: 3
Joined: Tue Jan 09, 2007 11:45 am

Post by nitinjavakid »

thanks
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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'.
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

Heap table is new to me. Will you please give a brief on implementing heap table using php ?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply