From: <bo...@el...> - 2002-03-21 14:19:57
|
Karsten - include_once and require_once are used to ensure that files are not loaded more than once while the server is responding to a single request. We want to include the files only once per session. The variables need to survive across multiple page requests. For this, we need a session variable, hence: $lang_loaded["books"] =3D"yes" Thanks for the tip though. On 21 Mar 2002 at 12:51, Karsten Dambekalns wrote: > On Mit, M=E4r 20, 2002 at 11:57:20 -0600, bo...@el... wrote: > > > I'd like to suggest that there be multiple files, and that > > one definition inside that file would indicate that it > > has already been loaded. > > $lang_loaded["books"] =3D "yes"; //module is called "books" > > This way, we only load what is needed. > > > > If not ($lang_loaded["books"]) { > > include 'books_file' > > } > > Ahem. Did you know about include_once() and it's sister > require_once()? There are even functions to query for all > included/required files. This should solve the problem better and > faster... > > Regards, > Karsten > -- > fishfarm netsolutions - Karsten Dambekalns > Echternstra=DFe 73 - 38100 Braunschweig > > Tel. +49 531 1232902 k.d...@fi... > Fax. +49 531 1232906 http://www.fishfarm.de/ > ----------------------------------------------------- > > > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers |