You are here: application-wide shared data/object « PHP « IT news, forums, messages
application-wide shared data/object

Posted by Aiguo Fei on 10/21/24 11:22

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация