Aiguo Fei wrote:
In ASP.Net there is the concept of "application" which is a virtual directory on a Web server. An application can have application-wide shared data/objects, which can be accessed by any script of that application (i.e., scripts under the virtual directory). I have gone through several PHP books, haven't seen it mentioned anywhere that PHP has similar facility. I don't know if anyone has written an extention to do something similar. Or any experience/suggestion on this matter. To make it clear, consider the following example. I want to do web-based dictionary. To achieve good performance, I want to load the whole dictionary into memory when the "application" starts (e.g., when the web server starts, or triggered when the first script under a certain directory is requested), and build a lookup table; then create a globally-accessible object, let's say, Application["my_dict"]; and it provides a function to do the dictionary lookup. In a script, one could do something like: $definition=Application["my_dict"]->lookup( $word ); For a complete solution, it should support object locking/exclusive access as well.
I think you'll the solution to your problem in "Advanced PHP Programing" by Geo Schlossnagle. It covers large-scale Web sites in depth. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php